-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
61 lines (55 loc) · 2.04 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
version: "3"
services:
srv1:
container_name: consul-srv1
image: consul:latest
command: consul agent -node=srv1 -server -bootstrap -client=0.0.0.0 -data-dir=/consul/data -datacenter=${DATA_CENTER_NAME}
restart: always
volumes:
- ${SERVER_1_DATA}:/consul/data
- ${SERVER_1_CONFIG}:/consul/config
networks:
- console-cluster
environment:
- 'CONSUL_LOCAL_CONFIG={"skip_leave_on_interrupt": true}'
- CONSUL_BIND_INTERFACE=eth0
srv2:
container_name: consul-srv2
image: consul:latest
command: consul agent -node=srv2 -server -retry-join=srv1 -client=0.0.0.0 -data-dir=/consul/data -datacenter=${DATA_CENTER_NAME}
restart: always
volumes:
- ${SERVER_2_DATA}:/consul/data
- ${SERVER_2_CONFIG}:/consul/config
networks:
- console-cluster
environment:
- 'CONSUL_LOCAL_CONFIG={"skip_leave_on_interrupt": true}'
- CONSUL_BIND_INTERFACE=eth0
srv3:
container_name: consul-srv3
image: consul:latest
command: consul agent -node=srv3 -server -retry-join=srv1 -client=0.0.0.0 -data-dir=/consul/data -datacenter=${DATA_CENTER_NAME}
restart: always
volumes:
- ${SERVER_3_DATA}:/consul/data
- ${SERVER_3_CONFIG}:/consul/config
networks:
- console-cluster
environment:
- 'CONSUL_LOCAL_CONFIG={"skip_leave_on_interrupt": true}'
- CONSUL_BIND_INTERFACE=eth0
ui:
container_name: consul-ui
image: consul:latest
command: consul agent -node=ui -retry-join=srv1 -client=0.0.0.0 -ui -data-dir=/consul/data -datacenter=${DATA_CENTER_NAME}
restart: always
ports:
- ${UI_PORT}:8500
networks:
- console-cluster
environment:
- 'CONSUL_LOCAL_CONFIG={"skip_leave_on_interrupt": true}'
- CONSUL_BIND_INTERFACE=eth0
networks:
console-cluster: