-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproduction.yml
86 lines (80 loc) · 1.8 KB
/
production.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
version: '3'
services:
postgres:
image: postgres:11.6
container_name: prod_postgres_service
ports:
- "5432:5432"
networks:
service:
aliases:
- postgres
django:
restart: always
build:
context: .
dockerfile: ./compose/production/django/Dockerfile
image: prod_asura_service
container_name: prod_django_service
volumes:
- .:/app
ports:
- "8000:8000"
env_file:
- .envs/.production/.django
command: >
bash -c "python wait_for_postgres.py &&
./manage.py migrate &&
daphne -b 0.0.0.0 -p 8000 asura.asgi:application"
networks:
service:
aliases:
- django
redis:
image: redis:latest
container_name: prod_asura_redis
ports:
- "6379:6379"
networks:
service:
aliases:
- redis
celery:
build:
context: .
dockerfile: ./compose/production/celery/Dockerfile
image: prod_asura_celery
container_name: prod_asura_celery
volumes:
- .:/app
env_file:
- .envs/.production/.django
command: >
sh -c "/wait && celery -A asura worker --loglevel=info"
environment:
WAIT_HOSTS: postgres:5432, redis:6379, django:8000
depends_on:
- redis
- postgres
- django
networks:
- service
celery_beat:
image: prod_asura_celery:latest
container_name: prod_celery_beat_service
volumes:
- .:/app
env_file:
- .envs/.production/.django
command: >
sh -c "/wait && celery -A asura beat -l info --scheduler django_celery_beat.schedulers:DatabaseScheduler"
environment:
WAIT_HOSTS: postgres:5432, redis:6379, django:8000
depends_on:
- redis
- postgres
- django
networks:
- service
networks:
service: