Repository navigation
Expand file tree
/
Copy pathdocker-stack.yml
More file actions
95 lines (90 loc) · 2.15 KB
/
Copy pathdocker-stack.yml
File metadata and controls
95 lines (90 loc) · 2.15 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# Production stack for Docker Swarm. Self-hosters: use docker-compose.yml.
services:
web:
image: ghcr.io/kanbn/subscriber.dev/web:latest
env_file:
- .env
stop_grace_period: 30s
healthcheck:
test: ["CMD-SHELL", "wget -qO- http://127.0.0.1:$$PORT/robots.txt"]
interval: 5s
timeout: 10s
retries: 3
start_period: 60s
networks:
- internal
deploy:
replicas: 1
labels:
- traefik.swarm.lbswarm=true
update_config:
order: start-first
failure_action: rollback
monitor: 30s
rollback_config:
order: start-first
restart_policy:
condition: any
api:
image: ghcr.io/kanbn/subscriber.dev/api:latest
env_file:
- .env
environment:
- REDIS_HOST=redis
- PORT=3001
stop_grace_period: 30s
healthcheck:
test: ["CMD-SHELL", "wget -qO- http://localhost:$$PORT/health"]
interval: 5s
timeout: 10s
retries: 3
start_period: 30s
networks:
- internal
deploy:
replicas: 1
labels:
- traefik.swarm.lbswarm=true
update_config:
order: start-first
failure_action: rollback
monitor: 30s
rollback_config:
order: start-first
restart_policy:
condition: any
postgres:
image: postgres:18.6@sha256:bd5dfa494a5a259704365813dbfa5fa6b3e69be7348d43b547f540c730478583
env_file:
- .env
environment:
- POSTGRES_DB=subscriber_db
- POSTGRES_USER=subscriber
volumes:
- sub_postgres_data:/var/lib/postgresql
ports:
- target: 5432
published: ${POSTGRES_PORT:?}
mode: host
networks:
- internal
deploy:
restart_policy:
condition: any
redis:
image: redis:7.4.12-alpine@sha256:4783bb5c3ecd5a93ce0a779ed2c44d5472043bb2cb7251f5390700748c62e62b
env_file:
- .env
command: ["sh", "-c", "exec redis-server --requirepass \"$$REDIS_PASSWORD\""]
volumes:
- sub_redis_data:/data
networks:
- internal
deploy:
restart_policy:
condition: any
networks:
internal:
volumes:
sub_postgres_data:
sub_redis_data: