-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.prod.yml
167 lines (157 loc) · 3.81 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
version: "3.9"
services:
frontend:
container_name: frontend
build:
context: ./frontend
dockerfile: Dockerfile.prod
ports:
- "5173:5173"
volumes:
- ./frontend:/frontend
- ./frontend/build:/frontend/dist
- /frontend/node_modules
tty: true
stdin_open: true
networks:
- gtd
backend:
container_name: backend
env_file:
- ./backend/.env
build:
context: ./backend
dockerfile: Dockerfile
volumes:
- ./backend:/backend
- ./backend/static:/backend/static
- ./backend/log:/var/log/backend
command: sh -c "gunicorn gtd.wsgi:application --preload --bind 0.0.0.0:8000 --timeout 240 -k gevent"
restart: on-failure
ports:
- "8000:8000"
expose:
- 8000
tty: true
networks:
- gtd
extra_hosts:
- "host.docker.internal:host-gateway"
rabbitmq:
hostname: gtdhost
container_name: rabbitmq
image: rabbitmq:3-management
command: rabbitmq-server
restart: unless-stopped
env_file:
- ./backend/.env
environment:
- RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS=-rabbit handshake_timeout 120000
ports:
- "5672:5672"
- "15672:15672"
volumes:
- ./backend:/backend
networks:
- gtd
celery_worker:
container_name: celery_worker
restart: always
build:
context: ./backend
dockerfile: Dockerfile
command: "celery -A gtd.celery worker --loglevel=info --pool=gevent --concurrency=12"
depends_on:
- rabbitmq
- backend
volumes:
- ./backend:/backend
networks:
- gtd
nginx:
container_name: nginx
restart: unless-stopped
build:
context: ./nginx
ports:
- "80:80"
- "443:443"
expose:
- 80
- 443
volumes:
- ./frontend/build:/var/www/frontend
- ./backend/static:/backend/static
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
- /etc/nginx/certificate.pem:/etc/nginx/certificate.pem
- /etc/nginx/private.key:/etc/nginx/private.key
depends_on:
- backend
- frontend
networks:
- gtd
prometheus:
image: prom/prometheus
volumes:
- prometheus_data:/prometheus
- ./prometheus/:/etc/prometheus/
command:
- "--config.file=/etc/prometheus/prometheus.yml"
- "--storage.tsdb.path=/prometheus"
- "--web.console.libraries=/etc/prometheus/console_libraries"
- "--web.console.templates=/etc/prometheus/consoles"
- "--storage.tsdb.retention.time=200h"
- "--web.enable-lifecycle"
ports:
- 9090:9090
container_name: prometheus
networks:
- gtd
extra_hosts:
- "host.docker.internal:host-gateway"
node-exporter:
image: prom/node-exporter:latest
container_name: node-exporter
restart: unless-stopped
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /:/rootfs:ro
command:
- "--path.procfs=/host/proc"
- "--path.rootfs=/rootfs"
- "--path.sysfs=/host/sys"
- "--collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($$|/)"
ports:
- 9100:9100
expose:
- 9100
networks:
- gtd
extra_hosts:
- "host.docker.internal:host-gateway"
grafana:
image: grafana/grafana
container_name: grafana
volumes:
- grafana_data:/var/lib/grafana
- ./grafana/provisioning/dashboards:/etc/grafana/provisioning/dashboards
- ./grafana/provisioning/datasources:/etc/grafana/provisioning/datasources
ports:
- 3001:3000
environment:
- GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=admin
- GF_USERS_ALLOW_SIGN_UP=false
depends_on:
- prometheus
expose:
- 3001
networks:
- gtd
volumes:
prometheus_data: {}
grafana_data: {}
networks:
gtd:
driver: bridge