forked from jakubhajek/traefik-consul-swarm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
stack-app.yml
80 lines (77 loc) · 1.86 KB
/
stack-app.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
# docker stack deploy -c stack-app.yml app --with-registry-auth --prune
version: "3.7"
networks:
app:
driver: overlay
name: app
attachable: true
driver_opts:
encrypted: "true"
proxy:
external: true
services:
backend:
image: jakubhajek/nodejs-backend:latest
healthcheck:
test: wget --quiet --tries=1 --spider http://localhost:3000/ || exit 1
interval: 1s
timeout: 5s
retries: 1
start_period: 5s
networks:
- app
deploy:
mode: replicated
replicas: 2
update_config:
failure_action: rollback
parallelism: 1
delay: 5s
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
resources:
limits:
memory: 64M
frontend:
image: nginx:1.17-alpine
healthcheck:
test: wget --quiet --tries=1 --spider http://localhost:80/ || exit 1
interval: 1s
timeout: 5s
retries: 3
start_period: 5s
networks:
- app
- proxy
configs:
- source: nginx_config
target: /etc/nginx/nginx.conf
deploy:
mode: replicated
replicas: 2
update_config:
failure_action: rollback
parallelism: 1
delay: 10s
restart_policy:
condition: on-failure
delay: 10s
max_attempts: 3
labels:
- traefik.enable=true
- traefik.backend=nginx-frontend
- traefik.docker.network=proxy
- traefik.port=80
- traefik.docker.tags=${TRAEFIK_PUBLIC_TAG:-nginx-frontend}
- traefik.frontend.rule=Host:node-app.${DOMAIN:-labs.cometari.eu}
- traefik.backend.healthcheck.path=/healthcheck
- traefik.backend.healthcheck.interval=1s
resources:
limits:
memory: 64MB
configs:
nginx_config:
name: nginx-config-${NGINX_CONFIG:-1}
file: nginx.conf