-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
102 lines (93 loc) · 1.77 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
version: '4'
services:
nginx:
container_name: nginx
hostname: nginx
image: nginx:1.25
volumes:
- ./docker/nginx.conf:/etc/nginx/nginx.conf:ro
networks:
- sublate
ports:
- "9999:9999"
depends_on:
- app1
- app2
- app3
app1: &appbase
container_name: app1
hostname: app1
image: python:slim
environment:
- PYTHONPATH=/app
command:
- "sh"
- "-c"
- |
pip install -r /app/requirements.txt
uvicorn app.main:app --host 0.0.0.0 --port 80 --workers 1 --timeout-keep-alive 65
volumes:
- ./:/app
networks:
- sublate
expose:
- "80"
depends_on:
- cache
- postgres
- queue
app2:
<<: *appbase
container_name: app2
hostname: app2
worker:
container_name: worker
hostname: worker
image: python:slim
environment:
- PYTHONPATH=/app
command:
- "sh"
- "-c"
- |
pip install -r /app/requirements.txt
celery -A app.worker worker --concurrency 3 --loglevel=debug
volumes:
- ./:/app
networks:
- sublate
depends_on:
- postgres
- queue
cache:
container_name: redis
hostname: redis
image: redis:7.2
networks:
- sublate
ports:
- "6379:6379"
queue:
container_name: queue
hostname: queue
image: rabbitmq:management
networks:
- sublate
ports:
- "5672:5672"
- "15672:15672"
postgres:
container_name: postgres
hostname: postgres
image: postgres:15.4
environment:
POSTGRES_USER: sublate
POSTGRES_PASSWORD: DaorMaelon
POSTGRES_DB: api
networks:
- sublate
ports:
- "5432:5432"
networks:
sublate:
driver: bridge