Newer
Older
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
version: "3.8"
services:
redis:
image: redis:alpine
networks:
- app_network
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 3
deploy:
restart_policy:
condition: any
backend:
image: md5_backend:latest
deploy:
replicas: 1
restart_policy:
condition: any
mode: replicated
placement:
constraints: [node.role == manager]
ports:
- target: 5000
published: 5000
protocol: tcp
mode: host
networks:
- app_network
environment:
- REDIS_HOST=redis
- REDIS_PORT=6379
depends_on:
- redis
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:5000/health"]
interval: 10s
timeout: 5s
retries: 3
networks:
app_network:
driver: overlay