-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.prod.yaml
91 lines (82 loc) · 1.9 KB
/
docker-compose.prod.yaml
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
89
90
91
version: '3.7'
services:
cache:
image: redis:alpine
restart: always
ports:
- "${REDIS_PORT}:${REDIS_PORT}"
command: redis-server
container_name: cache
volumes:
- cache_data:/data
db:
image: mongo
restart: always
ports:
- "27017:27017"
environment:
- MONGO_INITDB_ROOT_USERNAME=${MONGO_USERNAME}
- MONGO_INITDB_ROOT_PASSWORD=${MONGO_PASSWORD}
container_name: db
volumes:
- db_data:/data/db
broker:
image: rabbitmq
container_name: broker
hostname: rabbitmq
environment:
- RABBITMQ_DEFAULT_USER=${RABBITMQ_USER}
- RABBITMQ_DEFAULT_PASS=${RABBITMQ_PASSWORD}
ports:
- "${RABBITMQ_PORT}:${RABBITMQ_PORT}"
volumes:
- broker_data:/data
healthcheck:
test: rabbitmq-diagnostics -q ping
interval: 10s
timeout: 10s
retries: 2
bot:
build:
context: .
dockerfile: bot.Dockerfile
container_name: bot
restart: always
volumes:
- ./engbot:/code/bot/engbot
depends_on:
db:
condition: service_started
broker:
condition: service_healthy
worker:
build:
dockerfile: dev.Dockerfile
context: .
container_name: worker
restart: always
entrypoint: bash -c "export DEBUG=0 && celery -A engbot.tasks.tasks:scheduler worker --loglevel=info"
volumes:
- ./engbot:/code/bot/engbot
depends_on:
bot:
condition: service_started
broker:
condition: service_healthy
beater:
build:
dockerfile: dev.Dockerfile
context: .
container_name: beater
entrypoint: bash -c "export DEBUG=0 && celery -A engbot.tasks.tasks beat --loglevel=info"
volumes:
- ./engbot:/code/bot/engbot
depends_on:
bot:
condition: service_started
broker:
condition: service_healthy
volumes:
cache_data:
db_data:
broker_data: