-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose-prod.yml
71 lines (64 loc) · 1.81 KB
/
docker-compose-prod.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
version: "3.8"
services:
# Django app, order microservice
web:
build: .
container_name: djangoorders
command: >
sh -c "python manage.py wait_for_db &&
python manage.py migrate &&
python manage.py collectstatic --noinput &&
gunicorn order_microservice.wsgi:application --bind 0.0.0.0:8000"
volumes:
- static_volume:/data/static
environment:
STATIC_ROOT: "/data/static"
env_file:
- .env.prod
restart: 'always'
# Listens all product-related data from message broker
product_queue_listener_orders:
build: .
container_name: product_queue_listener_orders
command: python manage.py launch_product_queue_listener
env_file:
- .env.prod
restart: 'always'
# Listens all user-related data from message broker
user_data_queue_listener_orders:
build: .
container_name: user_data_queue_listener_orders
command: python manage.py launch_user_queue_listener
env_file:
- .env.prod
restart: 'always'
# Executes background tasks
dramatiq_worker_orders:
build: .
container_name: dramatiq_worker_orders
command: python manage.py rundramatiq --processes 1 --threads 2
env_file:
- .env.prod
restart: 'always'
# Executes periodic tasks
dramatiq_crontab_worker_orders:
build: .
container_name: dramatiq_crontab_worker_orders
command: python manage.py crontab
env_file:
- .env.prod
restart: 'always'
# Nginx reverse proxy
nginx:
image: nginx:1.27.1
container_name: nginx_reverse_proxy
ports:
- "80:80"
depends_on:
- web
volumes:
- static_volume:/data/static
- ./nginx/default.conf:/etc/nginx/conf.d/default.conf
restart: 'always'
volumes:
static_volume: # Define the volume where static files will be stored