-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.prod.yml
221 lines (204 loc) · 4.65 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
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
version: "3"
networks:
doh:
driver: bridge
services:
frontend:
container_name: frontend
build:
context: ./frontend
dockerfile: Dockerfile.prod
volumes:
- ./frontend/:/frontend
- build_folder:/frontend/dist
- ./frontend/node_modules/:/frontend/node_modules
tty: true
backend:
container_name: backend
build: ./backend
command: >
bash -c "python3 manage.py makemigrations images &&
python3 manage.py makemigrations styles &&
python3 manage.py migrate &&
gunicorn backend.wsgi --bind 0.0.0.0:8080 --timeout 240"
ports:
- "8080:8080"
volumes:
- ./backend:/app
- static_volume:/backend/staticfiles
- media_volume:/backend/mediafiles
depends_on:
- rabbitmq
- redis
networks:
- doh
nginx:
build: ./nginx
container_name: nginx
ports:
- "80:80"
# - "443:443"
expose:
- 80
# - 443
volumes:
- static_volume:/backend/staticfiles
- media_volume:/backend/mediafiles
- build_folder:/var/www/frontend
depends_on:
- backend
- frontend
networks:
- doh
ai:
container_name: ai
build: ./ai
command: >
bash -c "python3 manage.py makemigrations &&
python3 manage.py migrate &&
python3 manage.py runserver 0.0.0.0:8081"
ports:
- "8081:8081"
volumes:
- ./ai:/ai
depends_on:
- backend
networks:
- doh
redis:
container_name: redis
image: redis:latest
hostname: redis
ports:
- "6379:6379"
networks:
- doh
rabbitmq:
container_name: rabbitmq
image: rabbitmq:3-management-alpine
environment:
- RABBITMQ_USER=guest
- RABBITMQ_PASSWORD=guest
ports:
- "5672:5672"
- "15672:15672"
expose:
- "15672"
networks:
- doh
celery_worker_1:
container_name: celery_worker_1
restart: always
build:
context: ./backend
dockerfile: dockerfile
volumes:
- ./backend:/backend
environment:
- C_FORCE_ROOT=true
command: sh -c "celery -A backend worker --loglevel=info"
depends_on:
- rabbitmq
- redis
- backend
networks:
- doh
celery_worker_2:
container_name: celery_worker_2
restart: always
build:
context: ./backend
dockerfile: dockerfile
volumes:
- ./backend:/backend
environment:
- C_FORCE_ROOT=true
command: sh -c "celery -A backend worker --loglevel=info"
depends_on:
- rabbitmq
- redis
- backend
networks:
- doh
prometheus:
container_name: prometheus
image: prom/prometheus:latest
restart: always
ports:
- "9090:9090"
links:
- cadvisor
- alertmanager
volumes:
- ./monitoring/prometheus/:/etc/prometheus/
user: root
depends_on:
- cadvisor
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.console.libraries=/usr/share/prometheus/console_libraries'
- '--web.console.templates=/usr/share/prometheus/consoles'
networks:
- doh
grafana:
build:
context: ./monitoring/grafana
container_name: grafana
ports:
- "3100:3000"
depends_on:
- prometheus
networks:
- doh
node-exporter:
container_name: node-exporter
image: prom/node-exporter
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /:/rootfs:ro
command:
- '--path.procfs=/host/proc'
- '--path.sysfs=/host/sys'
- --collector.filesystem.ignored-mount-points
- "^/(sys|proc|dev|host|etc|rootfs/var/lib/docker/containers|rootfs/var/lib/docker/overlay2|rootfs/run/docker/netns|rootfs/var/lib/docker/aufs)($$|/)"
ports:
- "9200:9100"
restart: always
networks:
- doh
alertmanager:
container_name: alertmanager
image: prom/alertmanager
ports:
- "9093:9093"
volumes:
- ./monitoring/alertmanager/:/etc/alertmanager/
restart: always
command:
- '--config.file=/etc/alertmanager/config.yml'
- '--storage.path=/alertmanager'
networks:
- doh
cadvisor:
container_name: cadvisor
image: gcr.io/cadvisor/cadvisor:v0.46.0
volumes:
- /:/rootfs:ro
- /var/run:/var/run:rw
- /sys:/sys:ro
- /var/lib/docker/:/var/lib/docker:ro
ports:
- "8090:8090"
command:
- '-port=8090'
restart: always
networks:
- doh
volumes:
static_volume: null
media_volume: null
build_folder: null
prometheus_data: null
grafana_data: null