-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
99 lines (99 loc) · 1.91 KB
/
docker-compose.yml
File metadata and controls
99 lines (99 loc) · 1.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
version: '3.7'
services:
gateway:
build:
context: .
target: gateway
hostname: gateway
networks:
private:
ipv4_address: 192.168.233.100
public:
ipv4_address: 192.168.234.100
sysctls:
- net.ipv4.ip_forward=1
- net.ipv4.conf.all.forwarding=1
cap_add:
- NET_ADMIN
devices:
- /dev/net/tun
volumes:
- ./bin:/app
entrypoint:
- /bin/sh
- -cx
- |
cat > /etc/dnsmasq.conf << EOF
address=/gateway.example.net/192.168.234.100
EOF
/etc/init.d/dnsmasq start
iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
tail -f /dev/null
web:
build:
context: .
target: web
hostname: private-web
networks:
private:
ipv4_address: 192.168.233.101
dns:
- 192.168.233.100
cap_add:
- NET_ADMIN
volumes:
- ./test/www:/var/www/html
entrypoint:
- /bin/sh
- -cx
- |
ip route del default
ip route add default via 192.168.233.100
docker-php-entrypoint apache2-foreground
client1:
build:
context: .
target: client
hostname: client1
networks:
public:
ipv4_address: 192.168.234.201
dns:
- 192.168.234.100
cap_add:
- NET_ADMIN
devices:
- /dev/net/tun
volumes:
- ./bin:/app
entrypoint: tail -f
client2:
build:
context: .
target: client
hostname: client2
networks:
public:
ipv4_address: 192.168.234.202
dns:
- 192.168.234.100
cap_add:
- NET_ADMIN
devices:
- /dev/net/tun
volumes:
- ./bin:/app
entrypoint: tail -f
networks:
private:
driver: bridge
ipam:
driver: default
config:
- subnet: 192.168.233.0/24
public:
driver: bridge
ipam:
driver: default
config:
- subnet: 192.168.234.0/24