forked from jakubhajek/traefik-consul-swarm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
stack-traefik.yml
88 lines (84 loc) · 2.42 KB
/
stack-traefik.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
# Maintainer: jakub.hajek@cometari.com @_jakubhajek
# docker stack deploy -c stack-traefik.yml proxy --with-registry-auth --prune
version: "3.7"
services:
traefik:
image: traefik:1.7.12
command:
- --api
- --consul.endpoint=consul-leader:8500
- --docker.swarmmode
- --docker.watch
- --docker.exposedbydefault=false
- --docker.swarmModeRefreshSeconds=5
- --entrypoints=Name:http Address::80 Redirect.EntryPoint:https
- --entrypoints=Name:https Address::443 TLS
- --defaultentrypoints=http,https
- --metrics
- --metrics.prometheus
- --logLevel=ERROR
- --accessLog
- --acme
- --acme.email=kuba@cometari.com
- --acme.storage=traefik/acme/account
- --acme.entryPoint=https
- --acme.httpchallenge.entrypoint=http
- --acme.httpchallenge
- --acme.onhostrule=true
- --acme.acmelogging=true
networks:
- traefik-consul
- proxy
ports:
# - target: 80
# published: 80
# mode: host
# - target: 443
# published: 443
# mode: host
- "80:80"
- "443:443"
deploy:
replicas: ${TRAEFIK_REPLICAS:-1}
restart_policy:
condition: on-failure
placement:
constraints:
- node.role == manager
preferences:
- spread: node.id
labels:
- traefik.frontend.rule=Host:traefik.${DOMAIN:-labs.cometari.eu}
- traefik.enable=true
- traefik.port=8080
- traefik.docker.network=proxy
- traefik.frontend.auth.basic.users=admin:$$2y$$05$$1OX5jZ1Kpm/iVKE8tgUhu.STmPkgi0lLxVeP5yEcRioFdV4mcgdTu
volumes:
- /var/run/docker.sock:/var/run/docker.sock
visualizer:
image: dockersamples/visualizer
networks:
- proxy
deploy:
replicas: 1
placement:
constraints: [node.role == manager]
labels:
- traefik.frontend.rule=Host:viz.${DOMAIN:-labs.cometari.eu}
- traefik.enable=true
- traefik.port=8080
- traefik.docker.network=proxy
- traefik.tags=${TRAEFIK_PUBLIC_TAG:-visualizer}
- traefik.frontend.auth.basic.users=admin:$$2y$$05$$1OX5jZ1Kpm/iVKE8tgUhu.STmPkgi0lLxVeP5yEcRioFdV4mcgdTu
volumes:
- /var/run/docker.sock:/var/run/docker.sock
volumes:
consul-data-leader-6:
consul-data-replica-6:
networks:
proxy:
driver: overlay
name: proxy
attachable: true
traefik-consul:
external: true