-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose-deploy.yml
276 lines (254 loc) · 6.3 KB
/
docker-compose-deploy.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
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
version: '7'
services:
nginx-example:
image: nginx:latest
container_name: nginx-example
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
networks:
- app-network
labels:
logging: "promtail"
logging_jobname: "containerlogs"
depends_on:
- frontend
- fastapi
- express
- django
restart: always
nginx-exporter:
image: nginx/nginx-prometheus-exporter:latest
container_name: nginx-exporter
ports:
- "9113:9113"
command: --nginx.scrape-uri=http://nginx-example:80/stub_status
depends_on:
- nginx-example
networks:
- app-network
prometheus-example:
image: prom/prometheus:v2.45.6
container_name: prometheus-example
ports:
- "9090:9090"
volumes:
- ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
- ./prometheus/alert-rules.yml:/etc/prometheus/alert-rules.yml
environment:
- SLACK_API_URL=${SLACK_API_URL}
command:
- '--config.file=/etc/prometheus/prometheus.yml'
networks:
- app-network
alertmanager:
image: prom/alertmanager:main
container_name: alertmanager
ports:
- "9093:9093"
volumes:
- ./alertmanager/alertmanager.yml:/etc/alertmanager/alertmanager.yml
- ./alertmanager/tmp:/data/
environment:
- SLACK_API_URL=${SLACK_API_URL}
command: --config.file=/etc/alertmanager/alertmanager.yml
networks:
- app-network
node_exporter:
image: quay.io/prometheus/node-exporter:v1.8.1
container_name: node_exporter
ports:
- "9100:9100"
command:
- '--path.rootfs=/host'
restart: unless-stopped
volumes:
- '/:/host:ro,rslave'
networks:
- app-network
cadvisor-example:
image: gcr.io/cadvisor/cadvisor:v0.49.1
container_name: cadvisor-example
ports:
- "8080:8080"
volumes:
- /:/rootfs:ro
- /var/run:/var/run:rw
- /sys:/sys:ro
- /var/lib/docker/:/var/lib/docker:ro
networks:
- app-network
grafana-example:
image: grafana/grafana:9.5.20
container_name: grafana-example
user: root
volumes:
- ./grafana:/etc/grafana/provisioning
- ./grafana/data:/var/lib/grafana
ports:
- "3000:3000"
networks:
- app-network
loki:
image: grafana/loki:latest
ports:
- 3100:3100
command: -config.file=/etc/loki/local-config.yaml
networks:
- app-network
promtail:
image: grafana/promtail:latest
container_name: promtail
volumes:
- ./promtail/config.yaml:/etc/promtail/docker-config.yaml
- /var/lib/docker/containers:/var/lib/docker/containers:ro
- /var/run/docker.sock:/var/run/docker.sock
command:
- -config.file=/etc/promtail/docker-config.yaml
- -config.expand-env=true
depends_on:
- loki
networks:
- app-network
fastapi:
image: ryanleetecheer/backend-test:1.0.10
container_name: fastapi
restart: always
ports:
- '8000:8000'
networks:
- app-network
express:
container_name: express
image: ryanleetecheer/backend-test:0.0.9-node
restart: always
ports:
- '3001:3001'
networks:
- app-network
depends_on:
- db
django:
container_name: django
image: ryanleetecheer/backend-test:0.0.8-django
restart: always
ports:
- '8002:8002'
networks:
- app-network
command: sh -c "python manage.py migrate && python manage.py runserver 0.0.0.0:8002"
depends_on:
- db
celery-worker:
container_name: celery-worker
image: ryanleetecheer/backend-test:0.0.8-django
restart: always
ports:
- '5555:5555'
networks:
- app-network
depends_on:
- rabbitmq-example
- redis-example
environment:
- CELERY_BROKER_API_URL=http://guest:guest@rabbitmq-example:15672/api/
- CELERY_BROKER_URL=amqp://guest:guest@rabbitmq-example:5672/
command: sh -c "sh start_celery_flower.sh"
rabbitmq-example:
image: rabbitmq:management
ports:
- "15672:15672"
- "5672:5672"
- "15692:15692"
networks:
- app-network
restart: always
tty: true
environment:
- RABBITMQ_DEFAULT_USER=guest
- RABBITMQ_DEFAULT_PASS=guest
redis-example:
image: redis:latest
container_name: redis-example
ports:
- "6379:6379"
networks:
- app-network
restart: always
redis-exporter:
image: oliver006/redis_exporter:latest
container_name: redis_exporter
environment:
- REDIS_ADDR=redis-example:6379
ports:
- "9121:9121"
networks:
- app-network
frontend:
image: ryanleetecheer/frontend-test:1.0.2
container_name: frontend
ports:
- "5173:5173"
command: yarn dev --host
restart: always
networks:
- app-network
db:
image: mysql:latest
container_name: db
restart: always
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: session_db
MYSQL_USER: session_example
MYSQL_PASSWORD: session_example
ports:
- '3306:3306'
volumes:
- db_data:/var/lib/mysql
networks:
- app-network
mysql-exporter:
image: prom/mysqld-exporter:main
container_name: mysql-exporter
ports:
- "9104:9104"
volumes:
- ./mysql-exporter/my-config.conf:/cfg/my-config.conf
environment:
- DATA_SOURCE_NAME='root:root@(db:3306)/session_db'
- collect.info_schema.tablestats=true
- collect.info_schema.userstats=true
- collect.info_schema.query_response_time=true
- collect.auto_increment.columns=true
- collect.binlog_size=true
- collect.perf_schema.eventsstatements=true
- collect.perf_schema.eventswaits=true
- collect.perf_schema.file_events=true
- collect.perf_schema.indexiowaits=true
- collect.perf_schema.tableiowaits=true
- collect.perf_schema.tablelocks=true
networks:
- app-network
depends_on:
- db
command:
- '--config.my-cnf=/cfg/my-config.conf'
phpmyadmin:
image: phpmyadmin/phpmyadmin
links:
- db:mysql
ports:
- "8001:80"
environment:
PMA_HOST: db
MYSQL_ROOT_PASSWORD: root
networks:
- app-network
networks:
app-network:
driver: bridge
volumes:
db_data: