-
Notifications
You must be signed in to change notification settings - Fork 1
/
traefik-consul.yml
106 lines (106 loc) · 2.47 KB
/
traefik-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
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
version: '3.3'
services:
consul-leader:
image: consul:1.10
command:
- agent
- -server
- -client=0.0.0.0
- -bootstrap-expect=1
- -ui
- -ui-content-path=/cluster/consul/ui/
environment:
CONSUL_BIND_INTERFACE: eth0
CONSUL_LOCAL_CONFIG: '{"leave_on_terminate": true}'
volumes:
- consul-data-leader:/consul/data
networks:
- default
- traefik-public
secrets:
- basic_auth_users
logging:
driver: json-file
options:
compress: 'true'
max-file: '3'
max-size: 10m
deploy:
labels:
traefik.docker.network: traefik-public
traefik.enable: 'true'
traefik.frontend.auth.basic.usersFile: /run/secrets/basic_auth_users
traefik.frontend.rule: PathPrefix:/cluster/consul/
traefik.port: '8500'
traefik.tags: traefik-public
placement:
constraints:
- node.labels.consul-host == true
consul-replica:
image: consul:1.10
command: agent -server -client=0.0.0.0 -retry-join=consul-leader
environment:
CONSUL_BIND_INTERFACE: eth0
CONSUL_LOCAL_CONFIG: '{"leave_on_terminate": true}'
volumes:
- consul-data-replica:/consul/data
networks:
- default
- traefik-public
logging:
driver: json-file
options:
compress: 'true'
max-file: '3'
max-size: 10m
deploy:
replicas: 0
traefik:
image: traefik:v1.7
ports:
- 80:80
- 443:443
volumes:
- /var/run/docker.sock:/var/run/docker.sock
networks:
- default
- traefik-public
secrets:
- basic_auth_users
configs:
-
source: traefik-config
target: /etc/traefik/traefik.toml
logging:
driver: json-file
options:
compress: 'true'
max-file: '3'
max-size: 10m
deploy:
labels:
traefik.docker.network: traefik-public
traefik.enable: 'true'
traefik.frontend.auth.basic.usersFile: /run/secrets/basic_auth_users
traefik.frontend.rule: PathPrefixStrip:/cluster/traefik/
traefik.port: '8080'
traefik.tags: traefik-public
placement:
constraints:
- node.labels.consul-host == true
networks:
default:
driver: overlay
traefik-public:
external: true
volumes:
consul-data-leader:
driver: local
consul-data-replica:
driver: local
configs:
traefik-config:
external: true
secrets:
basic_auth_users:
external: true