-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
62 lines (54 loc) · 1.36 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
version: '3'
services:
db:
image: postgres:11-alpine
environment:
POSTGRES_USER: example
POSTGRES_PASSWORD: publicsecret
POSTGRES_DB: pantry
ports:
- "127.0.0.1:5432:5432"
mq:
image: rabbitmq:3.7-management-alpine
environment:
RABBITMQ_DEFAULT_USER: example
RABBITMQ_DEFAULT_PASS: publicsecret
ports:
- "127.0.0.1:5672:5672"
- "127.0.0.1:15672:15672"
beat:
image: celery_pantry_example:latest
build:
context: .
depends_on:
- db
- mq
command: celery beat --app example_tasks
worker1:
image: celery_pantry_example:latest
depends_on:
- beat
hostname: example-worker-1
command: celery worker --app example_tasks -E
worker2:
image: celery_pantry_example:latest
depends_on:
- beat
hostname: example-worker-2
command: celery worker --app example_tasks -E
api:
image: celery_pantry_example:latest
depends_on:
- beat
command: bash -c "python manage.py migrate && python manage.py runserver 0.0.0.0:8000"
restart: unless-stopped
ports:
- "127.0.0.1:8000:8000"
monitor:
image: celery_pantry_example:latest
depends_on:
- api
command: python -m celery_pantry.monitor_task_events
restart: unless-stopped
environment:
DJANGO_SETTINGS_MODULE: example_project.settings