-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathdocker-compose.prod.yaml
More file actions
72 lines (72 loc) · 2.71 KB
/
docker-compose.prod.yaml
File metadata and controls
72 lines (72 loc) · 2.71 KB
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
services:
frontend:
image: lheuredescomptes.org:5000/admin/lheuredescomptes_frontend:${STAGE_NAME}
networks:
- traefik-public
deploy:
replicas: 2
update_config:
parallelism: 1
delay: 10s
failure_action: rollback
order: start-first
rollback_config:
parallelism: 1
delay: 5s
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
window: 120s
labels:
- "traefik.enable=true"
- "traefik.http.routers.`${TRAEFIK_ROUTER_NAME}`.rule=Host(`${DEPLOY_URL}`)"
- "traefik.http.routers.`${TRAEFIK_ROUTER_NAME}`.entrypoints=websecure"
- "traefik.http.routers.`${TRAEFIK_ROUTER_NAME}`.tls.certresolver=wildcardresolver"
- "traefik.http.services.`${TRAEFIK_ROUTER_NAME}`.loadbalancer.server.port=3000"
- "traefik.http.services.`${TRAEFIK_ROUTER_NAME}`.loadbalancer.healthcheck.path=/"
- "traefik.http.services.`${TRAEFIK_ROUTER_NAME}`.loadbalancer.healthcheck.interval=5s"
- "traefik.http.services.`${TRAEFIK_ROUTER_NAME}`.loadbalancer.healthcheck.timeout=3s"
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3000/"]
interval: 5s
timeout: 5s
retries: 12
start_period: 5s
backend:
image: lheuredescomptes.org:5000/admin/lheuredescomptes_backend:${STAGE_NAME}
networks:
- traefik-public
deploy:
replicas: 2
update_config:
parallelism: 1
delay: 10s
failure_action: rollback
order: start-first
rollback_config:
parallelism: 1
delay: 5s
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
window: 120s
labels:
- "traefik.enable=true"
- "traefik.http.routers.`${TRAEFIK_ROUTER_NAME}`-api.rule=Host(`api.${DEPLOY_URL}`)"
- "traefik.http.routers.`${TRAEFIK_ROUTER_NAME}`-api.entrypoints=websecure"
- "traefik.http.routers.`${TRAEFIK_ROUTER_NAME}`-api.tls.certresolver=wildcardresolver"
- "traefik.http.services.`${TRAEFIK_ROUTER_NAME}`-api.loadbalancer.server.port=8000"
- "traefik.http.services.`${TRAEFIK_ROUTER_NAME}`-api.loadbalancer.healthcheck.path=/health"
- "traefik.http.services.`${TRAEFIK_ROUTER_NAME}`-api.loadbalancer.healthcheck.interval=5s"
- "traefik.http.services.`${TRAEFIK_ROUTER_NAME}`-api.loadbalancer.healthcheck.timeout=3s"
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/health').read()"]
interval: 5s
timeout: 5s
retries: 12
start_period: 5s
networks:
traefik-public:
external: true