-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdocker-compose.yml
112 lines (112 loc) · 2.24 KB
/
docker-compose.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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
services:
cache:
image: valkey/valkey:latest
ports:
- "16379:6379"
hostname: cache
command: redis-server --appendonly yes
volumes:
- cache-data:/data
environment:
ALLOW_EMPTY_PASSWORD: "yes"
restart: unless-stopped
logging:
options:
max-size: 10m
max-file: "3"
healthcheck:
test:
- CMD
- redis-cli
- ping
interval: 1s
timeout: 3s
retries: 30
db:
image: postgres:16
ports:
- "15432:5432"
hostname: db
environment:
POSTGRES_PASSWORD: "app_password"
POSTGRES_USER: "app_user"
POSTGRES_DB: "chapter-app-db"
volumes:
- db-data:/var/lib/postgresql/data
restart: unless-stopped
logging:
options:
max-size: 10m
max-file: "3"
healthcheck:
test:
- CMD
- pg_isready
- -U
- app_user
- -d
- chapter-app-db
interval: 2s
timeout: 3s
retries: 40
app:
build:
context: .
dockerfile: deploy/docker/run/Dockerfile.backend
image: app:latest
restart: always
depends_on:
db:
condition: service_healthy
cache:
condition: service_healthy
ports:
- "8000:8000"
environment:
SAQ_USE_SERVER_LIFESPAN: "false"
env_file:
- .env
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 30s
retries: 3
start_period: 10s
timeout: 5s
worker:
image: app:latest
command: litestar workers run
restart: always
depends_on:
db:
condition: service_healthy
cache:
condition: service_healthy
env_file:
- .env
migrator:
image: app:latest
restart: "no"
command: litestar database upgrade --no-prompt
env_file:
- .env
depends_on:
db:
condition: service_healthy
cache:
condition: service_healthy
frontend:
build:
context: .
dockerfile: deploy/docker/run/Dockerfile.frontend
image: frontend:latest
restart: always
depends_on:
app:
condition: service_healthy
ports:
- "3000:3000"
env_file:
- .env
volumes:
db-data: {}
cache-data: {}