-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
81 lines (75 loc) · 1.61 KB
/
Copy pathdocker-compose.yaml
File metadata and controls
81 lines (75 loc) · 1.61 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
services:
library_service:
build:
context: .
env_file:
- .env
ports:
- "8000:8000"
volumes:
- ./:/app
command: >
sh -c "python manage.py wait_for_db &&
python manage.py migrate &&
python manage.py create_crontab_schedule &&
python manage.py create_interval_schedule &&
python manage.py runserver 0.0.0.0:8000"
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:8000" ]
interval: 10s
retries: 5
depends_on:
- db
telegram_bot:
build:
context: .
env_file:
- .env
volumes:
- ./:/app
command: >
sh -c "python notifications/run_telegram_bot.py"
depends_on:
- library_service
celery:
build:
context: .
volumes:
- ./:/app
command: >
sh -c "celery -A library_service worker --loglevel=info"
depends_on:
- redis
- db
redis:
image: redis:latest
expose:
- 6379
restart: always
healthcheck:
test: [ "CMD", "redis-cli", "ping" ]
celery-beat:
build:
context: .
volumes:
- ./:/app
command: >
sh -c "python manage.py wait_for_db &&
python manage.py wait_for_migrations &&
celery -A library_service beat --loglevel=info --scheduler django_celery_beat.schedulers:DatabaseScheduler"
depends_on:
- redis
- library_service
- db
db:
image: postgres:16.0-alpine3.17
restart: always
env_file:
- .env
ports:
- "5432:5432"
volumes:
- my_db:$PGDATA
volumes:
my_db:
my_media: