-
Notifications
You must be signed in to change notification settings - Fork 12
/
docker-compose.yml
59 lines (54 loc) · 1.37 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
version: '3.1'
#customise this with options from
#https://www.consul.io/docs/agent/options.html
services:
seed:
hostname: seed
image: consul:0.9.2
deploy:
replicas: 1
placement:
constraints:
- "engine.labels.access == consul_seed"
environment:
- "CONSUL_LOCAL_CONFIG={\"disable_update_check\": true}"
- "CONSUL_BIND_INTERFACE=eth0"
entrypoint:
- consul
- agent
- -server
- -bootstrap-expect=3
- -data-dir=/tmp/consuldata
- -bind={{ GetInterfaceIP "eth0" }}
networks:
- "consul"
cluster:
image: consul:0.9.2
depends_on:
- "seed"
deploy:
mode: global ##this will deploy to all nodes that
placement:
constraints:
- "engine.labels.access != consul_seed"
environment:
- "CONSUL_LOCAL_CONFIG={\"disable_update_check\": true}"
- "CONSUL_BIND_INTERFACE=eth0"
- "CONSUL_HTTP_ADDR=0.0.0.0"
entrypoint:
- consul
- agent
- -server
- -data-dir=/tmp/consuldata
- -bind={{ GetInterfaceIP "eth0" }}
- -client=0.0.0.0
- -retry-join=seed:8301
- -ui ##assuming you want the UI on
networks:
- "consul"
ports:
- "8500:8500"
- "8600:8600"
networks:
consul:
driver: overlay