-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
88 lines (80 loc) · 1.87 KB
/
docker-compose.yml
File metadata and controls
88 lines (80 loc) · 1.87 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
name: fastapi-old-upgraded
services:
web:
build: .
command: >
gunicorn app.main:app -k uvicorn.workers.UvicornWorker
-w 2 -b 0.0.0.0:8000 --timeout 60
env_file: .env
depends_on:
- db
- redis
ports:
- "9082:8000"
volumes:
- .:/app
healthcheck:
test: ["CMD-SHELL", "python -c \"import urllib.request,sys; sys.exit(0 if urllib.request.urlopen('http://localhost:8000/healthz').getcode()==200 else 1)\""]
interval: 10s
timeout: 3s
retries: 5
restart: unless-stopped
worker:
build: .
command: >
celery -A app.celery_app.celery worker --loglevel=info
--autoscale=20,2 -Q default,heavy -O fair
env_file: .env
depends_on:
- db
- redis
volumes:
- .:/app # <— той самий код і для воркера
restart: unless-stopped
beat:
build: .
command: celery -A app.celery_app.celery beat --loglevel=info
env_file: .env
depends_on:
- redis
volumes:
- .:/app
restart: unless-stopped
flower:
build: .
command: ["celery", "-A", "app.celery_app.celery", "flower", "--port=5555"]
env_file: .env
ports:
- "5557:5555"
depends_on:
- redis
volumes:
- .:/app
restart: unless-stopped
redis:
image: redis:7-alpine
command: redis-server --appendonly yes
volumes:
- redisdata:/data
restart: unless-stopped
db:
image: postgres:16-alpine
environment:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: app
volumes:
- pgdata:/var/lib/postgresql/data
restart: unless-stopped
nginx:
image: nginx:alpine
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
ports:
- "8089:80"
depends_on:
web:
condition: service_healthy
restart: unless-stopped
volumes:
pgdata:
redisdata: