This repository was archived by the owner on Dec 29, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.prod.yml
78 lines (71 loc) · 1.6 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
72
73
74
75
76
77
78
version: '3.9'
services:
redis:
image: redis:7-alpine
restart: always
ports:
- "6379:6379"
postgres:
image: postgres:14.5-alpine
restart: always
volumes:
- postgres_data:/var/lib/postgresql/data/
env_file:
- ./.env.db
backend:
build:
context: .
dockerfile: Dockerfile.prod
restart: always
command: >
sh -c "
python manage.py wait_for_database &&
python manage.py migrate --no-input &&
python manage.py init_stage &&
python manage.py collectstatic --no-input &&
gunicorn triproverochki.wsgi:application --bind 0.0.0.0:8000"
expose:
- 8000
volumes:
- ./:/home/app/backend/
- static_volume:/home/app/backend/static/
env_file:
- ./.env
- ./.env.db
depends_on:
- redis
- postgres
nginx:
build: ./nginx
restart: always
ports:
- "8023:8023"
# - "443:443"
volumes:
- static_volume:/home/app/backend/static/
depends_on:
- backend
celery-worker:
restart: always
build:
context: .
dockerfile: Dockerfile.prod
volumes:
- ./:/home/app/backend/
depends_on:
- redis
- backend
command: celery --app=triproverochki --workdir=/home/app/backend worker --loglevel=info
celery-beat:
restart: always
build:
context: .
dockerfile: Dockerfile.prod
volumes:
- ./:/home/app/backend/
depends_on:
- celery-worker
command: celery --app=triproverochki --workdir=/home/app/backend beat --loglevel=info
volumes:
postgres_data:
static_volume: