forked from jakubhajek/traefik-consul-swarm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
stack-consul.yml
52 lines (48 loc) · 1.43 KB
/
stack-consul.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
# docker stack deploy -c stack-consul.yml consul --with-registry-auth
version: "3.7"
services:
consul-leader:
image: consul:1.5
command: agent -server -client=0.0.0.0 -bootstrap -ui
volumes:
- consul-data-leader-1:/consul/data
environment:
- CONSUL_BIND_INTERFACE=eth0
- 'CONSUL_LOCAL_CONFIG={"leave_on_terminate": true}'
networks:
- traefik-consul
deploy:
replicas: 1
labels:
- traefik.frontend.rule=Host:consul.${DOMAIN:-labs.cometari.eu}
- traefik.backend=consul-leader
- traefik.enable=true
- traefik.port=8500
- traefik.frontend.auth.basic.users=admin:$$2y$$05$$1OX5jZ1Kpm/iVKE8tgUhu.STmPkgi0lLxVeP5yEcRioFdV4mcgdTu
consul-replica:
image: consul:1.5
command: agent -server -client=0.0.0.0 -retry-join="consul-leader"
volumes:
- consul-data-replica-1:/consul/data
environment:
- CONSUL_BIND_INTERFACE=eth0
- 'CONSUL_LOCAL_CONFIG={"leave_on_terminate": true}'
networks:
- traefik-consul
deploy:
replicas: ${CONSUL_REPLICAS:-3}
placement:
preferences:
- spread: node.id # Data ceneter, 'spread=node.labels.datacenter, datacenter=us-west,
labels:
- traefik.enable=false
volumes:
consul-data-leader-1:
consul-data-replica-1:
networks:
traefik-consul:
driver: overlay
attachable: true
name: traefik-consul
driver_opts:
encrypted: "true"