-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
72 lines (72 loc) · 1.74 KB
/
docker-compose.yaml
File metadata and controls
72 lines (72 loc) · 1.74 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
x-restart-policy: &restart_policy
restart: unless-stopped
x-healthcheck-defaults: &healthcheck_defaults
interval: 5s
timeout: 5s
retries: 10
start_period: 30s
x-app-defaults: &app_defaults
<<: *restart_policy
stop_grace_period: "5s"
volumes:
- ./data:/app/data
env_file:
- .env
depends_on:
- db
- redis
services:
app:
<<: *app_defaults
build: .
command: make prod-gunicorn
ports:
- "${ENTRY_PORT:-15000}:8000"
healthcheck:
<<: *healthcheck_defaults
test:
[
"CMD-SHELL",
"python -c 'import urllib.request as u, sys; u.urlopen(sys.argv[1])' http://localhost:8000/api/v1/ready",
]
celery:
<<: *app_defaults
build: .
command: make prod-celery
depends_on:
app:
condition: service_healthy
redis:
<<: *restart_policy
image: redis:8.0.1-alpine
volumes:
- redis_data:/data
healthcheck:
<<: *healthcheck_defaults
test: ["CMD", "redis-cli", "ping"]
db:
<<: *restart_policy
image: postgres:17.5-alpine3.21
shm_size: 256m
volumes:
- postgres_data:/var/lib/postgresql/data/
environment:
POSTGRES_DB: ${SQL_DATABASE:-postgres}
POSTGRES_USER: ${SQL_USER:-postgres}
POSTGRES_PASSWORD: ${SQL_PASSWORD:-postgres}
healthcheck:
<<: *healthcheck_defaults
test:
[
"CMD-SHELL",
"pg_isready -U ${SQL_USER:-postgres} -d ${SQL_DATABASE:-postgres}",
]
command: >
postgres
-c max_connections=${SQL_MAX_CONNECTIONS:-100}
-c shared_buffers=${SQL_SHARED_BUFFERS:-128MB}
-c work_mem=${SQL_WORK_MEM:-4MB}
-c effective_cache_size=${SQL_EFFECTIVE_CACHE_SIZE:-4GB}
volumes:
postgres_data:
redis_data: