-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
110 lines (102 loc) · 2.05 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
version: '3.8'
services:
web:
build:
context: .
dockerfile: Dockerfile
container_name: web_api
ports:
- "8000:8000"
environment:
CONFIG_FILE: ".prod.env"
SQLALCHEMY_WARN_20: 0
entrypoint: >
sh -c "
python3 main.py
"
volumes:
- main_app:/menu_app/reports/
networks:
- web_main_api
restart: on-failure
depends_on:
celery:
condition: service_started
db:
condition: service_healthy
cache_data:
condition: service_healthy
cache_data:
image: redis:latest
container_name: redis-db
volumes:
- redis_data:/var/lib/redis/data/
expose:
- 6379
env_file:
- ".prod.env"
networks:
- web_main_api
healthcheck:
test: [ "CMD", "redis-cli","ping" ]
interval: 10s
timeout: 5s
retries: 5
db:
image: postgres:15.1-alpine
container_name: db-pg
volumes:
- postgres_data:/var/lib/postgresql/data/
expose:
- 5432
env_file:
- ".prod.env"
restart: on-failure
healthcheck:
test: [ "CMD-SHELL", "pg_isready" ]
interval: 10s
timeout: 5s
retries: 5
networks:
- web_main_api
rabbitmq:
container_name: rabbit-mq
image: rabbitmq:3.11.8-alpine
healthcheck:
test: rabbitmq-diagnostics -q ping
interval: 30s
timeout: 30s
retries: 3
expose:
- 5672
volumes:
- rabbit_data:/var/lib/rabbit/data/
networks:
- web_main_api
celery:
build:
context: .
dockerfile: Dockerfile
container_name: celery
entrypoint: >
sh -c "
celery -A app.celery.celery_app worker -l info -Q celery -c 2
"
environment:
CONFIG_FILE: ".prod.env"
networks:
- web_main_api
restart: on-failure
depends_on:
rabbitmq:
condition: service_healthy
volumes:
- main_app:/menu_app/reports/
volumes:
postgres_data:
redis_data:
rabbit_data:
main_app:
networks:
web_main_api:
name: web_main_api