-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathdocker-compose.yml
116 lines (106 loc) · 3.28 KB
/
docker-compose.yml
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
version: "2"
services:
consul_server_1:
image: consul
networks:
consul_test:
ipv4_address: 172.16.231.11
command: consul agent -server -disable-host-node-id -bind=172.16.231.11 -data-dir /consul/data -config-dir /consul/config -bootstrap-expect=2 -retry-join=172.16.231.12 -retry-join=172.16.231.13
volumes:
- 'consul_data_1:/consul/data'
- './basic_config.json:/consul/config/basic_config.json'
ports:
- '8310:8300/udp'
- '8311:8301/udp'
- '8312:8302/udp'
- '8411:8400/tcp'
consul_server_2:
image: consul
networks:
consul_test:
ipv4_address: 172.16.231.12
command: consul agent -server -disable-host-node-id -bind=172.16.231.12 -data-dir /consul/data -config-dir /consul/config -retry-join=172.16.231.11 -retry-join=172.16.231.13
volumes:
- 'consul_data_2:/consul/data'
- './basic_config.json:/consul/config/basic_config.json'
ports:
- '8320:8300/udp'
- '8321:8301/udp'
- '8322:8302/udp'
- '8412:8400/tcp'
consul_server_3:
image: consul
networks:
consul_test:
ipv4_address: 172.16.231.13
command: consul agent -server -disable-host-node-id -bind=172.16.231.13 -data-dir /consul/data -config-dir /consul/config -retry-join=172.16.231.11 -retry-join=172.16.231.12
volumes:
- 'consul_data_3:/consul/data'
- './basic_config.json:/consul/config/basic_config.json'
ports:
- '8330:8300/udp'
- '8331:8301/udp'
- '8332:8302/udp'
- '8413:8400/tcp'
consul_client_1:
image: consul
command: consul agent -disable-host-node-id -client=172.16.231.21 -bind=172.16.231.21 -retry-join=172.16.231.11 -retry-join=172.16.231.12 -data-dir /consul/data -config-dir /consul/config
networks:
consul_test:
ipv4_address: 172.16.231.21
depends_on:
- consul_server_1
volumes:
- 'consul_client_1_data:/consul/data'
- './basic_config.json:/consul/config/basic_config.json'
ports:
- '8421:8400/tcp'
- '8521:8500/tcp'
- '8621:8600/udp'
- '8621:8600/tcp'
consul_client_2:
image: consul
command: consul agent -disable-host-node-id -client=172.16.231.22 -bind=172.16.231.22 -retry-join=172.16.231.11 -retry-join=172.16.231.12 -data-dir /consul/data -config-dir /consul/config
networks:
consul_test:
ipv4_address: 172.16.231.22
depends_on:
- consul_server_2
volumes:
- 'consul_client_2_data:/consul/data'
- './basic_config.json:/consul/config/basic_config.json'
ports:
- '8422:8400/tcp'
- '8522:8500/tcp'
- '8622:8600/udp'
- '8622:8600/tcp'
registrator:
image: gliderlabs/registrator:latest
hostname: registrator
networks:
consul_test:
ipv4_address: 172.16.231.51
volumes:
- /var/run/docker.sock:/tmp/docker.sock
depends_on:
- consul_client_2
command: -ttl 300 -ttl-refresh 120 -tags mhmb consul://172.16.231.22:8500
networks:
consul_test:
driver: bridge
ipam:
driver: default
config:
- subnet: 172.16.231.0/24
gateway: 172.16.231.1
volumes:
consul_data_1:
driver: local
consul_data_2:
driver: local
consul_data_3:
driver: local
consul_client_1_data:
driver: local
consul_client_2_data:
driver: local