/
production.yml
102 lines (96 loc) · 2.18 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
version: '2'
volumes:
postgres_data: {}
postgres_backup: {}
redis_data: {}
redis_backup: {}
services:
postgres:
image: postgres:9.6
volumes:
- postgres_data:/var/lib/postgresql/data
- postgres_backup:/backups
redis:
image: redis:4.0
volumes:
- redis_data:/var/lib/redis
- redis_backup:/backups
celeryworker:
build:
context: .
dockerfile: ./compose/web/Dockerfile
args:
requirements_file: production.txt
volumes:
- .:/app
depends_on:
- postgres
- redis
command: celery -A src.celery worker -l INFO --purge
env_file:
- .env_production
celerybeat:
build:
context: .
dockerfile: ./compose/web/Dockerfile
args:
requirements_file: production.txt
volumes:
- .:/app
depends_on:
- postgres
- redis
command: celery -A src.celery beat -l INFO
env_file:
- .env_production
web:
build:
context: .
dockerfile: ./compose/web/Dockerfile
args:
requirements_file: production.txt
image: infamily/infinity:latest
depends_on:
- postgres
- redis
- celeryworker
- celerybeat
command: daphne -b 0.0.0.0 -p 8001 config.asgi:channel_layer
env_file:
- .env_production
volumes:
- .:/app
- /var/www/static:/app/staticfiles
worker:
build:
context: .
dockerfile: ./compose/web/Dockerfile
args:
requirements_file: production.txt
image: infamily/infinity:latest
depends_on:
- postgres
- redis
- celeryworker
- celerybeat
command: python manage.py runworker
# TODO move it to .env_production file
env_file:
- .env_production
volumes:
- .:/app
- /var/www/static:/app/staticfiles
nginx:
image: nginx:1.12.1
depends_on:
- web
ports:
- "80:80"
- "443:443"
volumes:
- ./compose/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./compose/nginx/conf.d:/etc/nginx/conf.d:ro
- /var/log/nginx:/var/log/nginx
- /etc/letsencrypt:/etc/letsencrypt:ro
- /etc/ssl/certs/:/etc/ssl/certs:ro
- /var/www/static:/var/www/static