-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathproduction.yml
98 lines (91 loc) · 2.14 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
version: "3.8"
volumes:
static_volume: {}
media_volume: {}
certs: {}
local_postgres_data: {}
local_postgres_data_backups: {}
services:
django: &django
build:
context: .
dockerfile: ./compose/production/django/Dockerfile
image: name_django
restart: always
container_name: django
depends_on:
- postgres
volumes:
- .:/app:cached
- static_volume:/home/app/web/src/static
- media_volume:/home/app/web/src/media
env_file:
- ./.envs/.production/.django
- ./.envs/.production/.postgres
ports:
- "8000:8000"
command: /start
postgres:
build:
context: .
dockerfile: ./compose/production/postgres/Dockerfile
image: name_postgres
restart: always
container_name: postgres
volumes:
- local_postgres_data:/var/lib/postgresql/data:cached
- local_postgres_data_backups:/backups:cached
env_file:
- ./.envs/.production/.postgres
nginx:
build:
context: .
dockerfile: ./compose/production/nginx/Dockerfile
image: name_nginx
restart: always
container_name: nginx
volumes:
- static_volume:/home/app/web/src/static
- media_volume:/home/app/web/src/media
- certs:/etc/nginx/ssl
ports:
- 80:80
- 443:443
depends_on:
- django
redis:
image: redis:6.2-alpine
restart: always
container_name: name_redis
ports:
- "6379:6379"
celery:
build:
context: .
dockerfile: ./compose/production/django/Dockerfile
command: celery -A config worker -l info
container_name: name_celery
restart: always
volumes:
- .:/app:cached
env_file:
- ./.envs/.production/.django
- ./.envs/.production/.postgres
depends_on:
- postgres
- redis
celery-beat:
build:
context: .
dockerfile: ./compose/production/django/Dockerfile
command: celery -A config beat -l info
container_name: name_celery_beat
restart: always
volumes:
- .:/app:cached
env_file:
- ./.envs/.production/.django
- ./.envs/.production/.postgres
depends_on:
- redis
- postgres