-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.production.yml
More file actions
137 lines (126 loc) · 2.72 KB
/
docker-compose.production.yml
File metadata and controls
137 lines (126 loc) · 2.72 KB
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
name: democrasite
volumes:
production_postgres_data:
production_postgres_data_backups:
production_traefik:
production_django_media:
networks:
frontend:
backend:
metrics:
x-default-logging: &logging
driver: "json-file"
options:
max-size: "5m"
max-file: "2"
tag: "{{.Name}}|{{.ImageName}}|{{.ID}}"
services:
django: &django
build:
context: .
dockerfile: ./compose/production/django/Dockerfile
image: democrasite_production_django
volumes:
- production_django_media:/app/democrasite/media
networks:
- frontend
- backend
- metrics
depends_on:
- postgres
- redis
env_file:
- ./.envs/.production/.django
- ./.envs/.production/.postgres
command: /start
deploy:
resources:
limits:
cpus: "0.2"
memory: 500M
logging: *logging
postgres:
build:
context: .
dockerfile: ./compose/production/postgres/Dockerfile
image: democrasite_production_postgres
volumes:
- production_postgres_data:/var/lib/postgresql/data
- production_postgres_data_backups:/backups
networks:
- backend
env_file:
- ./.envs/.production/.postgres
deploy:
resources:
limits:
cpus: "0.2"
memory: 300M
logging: *logging
traefik:
build:
context: .
dockerfile: ./compose/production/traefik/Dockerfile
image: democrasite_production_traefik
depends_on:
- django
volumes:
- production_traefik:/etc/traefik/acme
ports:
- "0.0.0.0:80:80"
- "0.0.0.0:443:443"
- "0.0.0.0:5555:5555"
networks:
- frontend
deploy:
resources:
limits:
cpus: "0.1"
memory: 100M
logging: *logging
redis:
image: docker.io/redis:7
networks:
- backend
logging: *logging
celeryworker:
<<: *django
image: democrasite_production_celeryworker
depends_on:
- redis
networks:
- backend
command: /start-celeryworker
logging: *logging
celerybeat:
<<: *django
image: democrasite_production_celerybeat
networks:
- backend
command: /start-celerybeat
logging: *logging
flower:
<<: *django
image: democrasite_production_flower
networks:
- backend
- frontend
command: /start-flower
logging: *logging
nginx:
build:
context: .
dockerfile: ./compose/production/nginx/Dockerfile
image: democrasite_local_nginx
depends_on:
- django
volumes:
- production_django_media:/usr/share/nginx/media:ro
networks:
- frontend
deploy:
resources:
limits:
cpus: "0.1"
memory: 100M
logging: *logging