-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
60 lines (55 loc) · 1.34 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
version: "3.4"
services:
redis:
image: redis:latest
hostname: redis
networks:
- main
ports:
- "6379:6379"
restart: always
app:
image: cornellappdev/pear-django:${IMAGE_TAG}
hostname: app
env_file: .env
command: sh -c "python manage.py makemigrations && python manage.py migrate && gunicorn pear.wsgi -b 0.0.0.0:8000"
depends_on:
- redis
networks:
- main
restart: on-failure
deploy:
replicas: 2
restart_policy:
condition: on-failure
ports:
- 8000:8000
celery_worker:
image: cornellappdev/pear-django:${IMAGE_TAG}
hostname: celery_worker
env_file: .env
command: sh -c "./wait-for-it.sh redis:6379 && ./wait-for-it.sh app:8000 -- celery -A pear worker -l info"
depends_on:
- app
- redis
deploy:
replicas: 3
restart_policy:
condition: on-failure
networks:
- main
restart: always
celery_beat:
image: cornellappdev/pear-django:${IMAGE_TAG}
hostname: celery_beat
env_file: .env
command: sh -c "./wait-for-it.sh redis:6379 && ./wait-for-it.sh app:8000 -- celery -A pear beat -l INFO --scheduler django_celery_beat.schedulers:DatabaseScheduler"
depends_on:
- app
- redis
- celery_worker
networks:
- main
restart: always
networks:
main: