-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
74 lines (69 loc) · 1.47 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
services:
app:
container_name: fastapi
build: .
working_dir: /code
command: bash -c "alembic upgrade head && uvicorn app.main:app --host 0.0.0.0 --port 80"
restart: always
ports:
- "8000:80"
env_file:
- .env.example
volumes:
- .:/code
depends_on:
postgres:
condition: service_healthy
postgres:
image: postgres:15-bullseye
container_name: postgres
ports:
- "5432:5432"
env_file:
- .env.example
healthcheck:
test:
[
"CMD-SHELL",
"pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}"
]
interval: 10s
timeout: 3s
retries: 3
volumes:
- postgres_data:/var/lib/postgresql/data:cached
celery_worker:
container_name: celery_worker
build: .
command: celery -A app.tools worker -l INFO
env_file: .env.example
depends_on:
redis:
condition: service_started
postgres:
condition: service_healthy
volumes:
- .:/code
links:
- redis
celery_beat:
container_name: celery_beat
build: .
command: celery -A app.tools beat -l INFO
env_file: .env.example
depends_on:
redis:
condition: service_started
postgres:
condition: service_healthy
celery_worker:
condition: service_started
volumes:
- .:/code
links:
- redis
redis:
container_name: redis
image: redis:latest
volumes:
postgres_data: