-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
stack.yml
89 lines (80 loc) · 2.25 KB
/
stack.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
---
# https://docs.traefik.io/user-guide/swarm-mode/
# docker service create --name traefik --network traefik -p 9090:80 -p 9091:8080 --mount type=bind,source=/var/run/docker.sock,target=/var/run/docker.sock traefik --docker --docker.swarmmode --docker.domain=traefik --docker.watch --web
# docker service create --name app --network traefik --replicas 1 --label traefik.port=8080 --stop-grace-period 30s app
version: "3.2"
services:
traefik:
image: traefik
command: --web --docker --docker.domain=gesellix.local --docker.swarmmode --docker.watch
networks:
- traefik
ports:
- "80:80"
- "443:443"
- "8080:8080"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
deploy:
placement:
constraints:
- node.role==manager
replicas: 2
update_config:
parallelism: 1
delay: 60s
restart_policy:
condition: on-failure
app:
image: gesellix/graceful-spring-shutdown:${APP_VERSION:-2017-06-15T00-44-55}
volumes:
- /var/run/docker.sock:/var/run/docker.sock
networks:
- traefik
environment:
- "CATALINA.THREADPOOL.EXECUTION.TIMEOUT.SECONDS=30"
secrets:
- from_file
stop_grace_period: 60s
deploy:
labels:
- "traefik.port=8080"
- "traefik.docker.network=traefik"
- "traefik.frontend.rule=Host:localhost"
# - "traefik.frontend.rule=Host:app.gesellix.local"
# - "traefik.frontend.rule=PathStrip:/..."
# - "traefik.backend=..."
replicas: 2
update_config:
parallelism: 1
delay: 60s
restart_policy:
condition: on-failure
visualizer:
image: charypar/swarm-dashboard
ports:
- "9001:8080"
environment:
PORT: 8080
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
deploy:
replicas: 1
placement:
constraints: [node.role == manager]
portainer:
image: portainer/portainer
ports:
- "9000:9000"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
deploy:
placement:
constraints: [node.role == manager]
networks:
traefik:
# external: true
driver: overlay
secrets:
from_file:
file: stack-secret.txt