-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdocker-compose-infra.yml
314 lines (301 loc) · 7.33 KB
/
docker-compose-infra.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
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
---
version: '2.4'
volumes:
vmagent_etc:
driver: local
driver_opts:
device: $COMPOSEPATH/data/vmagent/etc
o: bind
type: bind
vmagent_data:
driver: local
driver_opts:
device: $COMPOSEPATH/data/vmagent/data
o: bind
type: bind
vmalert_etc:
driver: local
driver_opts:
device: $COMPOSEPATH/data/vmalert/etc
o: bind
type: bind
vm_metrics:
driver: local
driver_opts:
device: $COMPOSEPATH/data/vmmetrics
o: bind
type: bind
promgrafana_etc:
driver: local
driver_opts:
device: $COMPOSEPATH/data/promgrafana/etc
o: bind
type: bind
promgrafana_db:
driver: local
driver_opts:
device: $COMPOSEPATH/data/promgrafana/db
o: bind
type: bind
promgrafana_plugins:
driver: local
driver_opts:
device: $COMPOSEPATH/data/promgrafana/plugins
o: bind
type: bind
promgrafana_dashboards:
driver: local
driver_opts:
device: $COMPOSEPATH/data/promgrafana/etc/dashboards
o: bind
type: bind
alertmanager_etc:
driver: local
driver_opts:
device: $COMPOSEPATH/data/alertmanager/etc
o: bind
type: bind
sentryredis_data:
driver: local
driver_opts:
device: $COMPOSEPATH/data/sentry/redis
o: bind
type: bind
sentrypostgres_data:
driver: local
driver_opts:
device: $COMPOSEPATH/data/sentry/pg
o: bind
type: bind
services:
promgrafana:
image: grafana/grafana:6.3.6
restart: always
hostname: prometheusgrafana
env_file:
- .env.proxy
volumes:
- promgrafana_etc/:/etc/grafana
- promgrafana_db:/var/lib/grafana/
- promgrafana_plugins:/var/lib/grafana/plugins
- promgrafana_dashboards:/var/lib/grafana/dashboards
ports:
- "3000:3000"
depends_on:
- vm
environment:
GF_SERVER_ROOT_URL: https://promgrafana
GF_PATHS_PROVISIONING: /etc/grafana/provisioning
GF_INSTALL_PLUGINS: grafana-simple-json-datasource,
vertamedia-clickhouse-datasource
logging:
driver: $COMPOSE_LOG_DRIVER
options:
max-size: $COMPOSE_LOG_MAX_SIZE
max-file: $COMPOSE_LOG_MAX_FILE
labels:
- traefik.enable=false
vm:
container_name: vm
hostname: vm
restart: always
image: victoriametrics/victoria-metrics:v1.37.1
env_file:
- .env.infra
volumes:
- vm_metrics:/storage
command: >
-storageDataPath=/storage
-httpListenAddr=:8428
-envflag.enable
-envflag.prefix=vm_
logging:
driver: $COMPOSE_LOG_DRIVER
options:
max-size: $COMPOSE_LOG_MAX_SIZE
max-file: $COMPOSE_LOG_MAX_FILE
labels:
- traefik.enable=false
vmalert:
container_name: vmalert
hostname: vmalert
restart: always
image: victoriametrics/vmalert:v1.37.1
env_file:
- .env.infra
volumes:
- vmalert_etc:/rules:ro
ports:
- "8880:8880"
command: >
-datasource.url=http://vm:8428
-notifier.url=http://alertmanager:9093
-remoteWrite.url=http://vm:8428
-envflag.prefix=vmalert_
-envflag.enable
logging:
driver: $COMPOSE_LOG_DRIVER
options:
max-size: $COMPOSE_LOG_MAX_SIZE
max-file: $COMPOSE_LOG_MAX_FILE
labels:
- traefik.enable=false
vmagent:
container_name: vmagent
hostname: vmagent
restart: always
image: victoriametrics/vmagent:v1.37.1
env_file:
- .env.infra
volumes:
- vmagent_etc:/etc/prometheus
- vmagent_data:/vmagent-remotewrite-data
command: >
-promscrape.config=/etc/prometheus/prometheus.yml
-envflag.enable
-remoteWrite.url=http://vm:8428/api/v1/write
-envflag.prefix=vmagent_
logging:
driver: $COMPOSE_LOG_DRIVER
options:
max-size: $COMPOSE_LOG_MAX_SIZE
max-file: $COMPOSE_LOG_MAX_FILE
labels:
- traefik.enable=false
promclickhouse:
image: f1yegor/clickhouse-exporter
restart: always
command: -scrape_uri=http://default:@clickhouse:8123/
logging:
driver: $COMPOSE_LOG_DRIVER
options:
max-size: $COMPOSE_LOG_MAX_SIZE
max-file: $COMPOSE_LOG_MAX_FILE
labels:
- traefik.enable=false
# read ./data/alertmanager/etc/Readme.md before start container
alertmanager:
image: prom/alertmanager:latest
restart: always
hostname: alertmanager
volumes:
- alertmanager_etc:/etc/alertmanager
ports:
- "9093:9093"
command: >
--config.file=/etc/alertmanager/alertmanager.conf
--log.level=info
logging:
driver: $COMPOSE_LOG_DRIVER
options:
max-size: $COMPOSE_LOG_MAX_SIZE
max-file: $COMPOSE_LOG_MAX_FILE
labels:
- traefik.enable=false
prommongo:
image: eses/mongodb_exporter
restart: always
hostname: prommongo
command: >
-mongodb.uri=mongodb://noc:$NOC_MONGO_PASSWORD@mongo:27017
logging:
driver: $COMPOSE_LOG_DRIVER
options:
max-size: $COMPOSE_LOG_MAX_SIZE
max-file: $COMPOSE_LOG_MAX_FILE
labels:
- traefik.enable=false
sentry-redis:
image: redis:alpine
hostname: sentry-redis
restart: always
volumes:
- sentryredis_data:/data
logging:
driver: $COMPOSE_LOG_DRIVER
options:
max-size: $COMPOSE_LOG_MAX_SIZE
max-file: $COMPOSE_LOG_MAX_FILE
labels:
- traefik.enable=false
sentry-postgres:
image: postgres:9.6-alpine
hostname: sentry-postgres
restart: always
env_file:
- ./data/sentry/sentry.env
volumes:
- sentrypostgres_data:/var/lib/postgresql/data
ulimits:
nproc: 65535
nofile:
soft: 20000
hard: 40000
logging:
driver: $COMPOSE_LOG_DRIVER
options:
max-size: $COMPOSE_LOG_MAX_SIZE
max-file: $COMPOSE_LOG_MAX_FILE
labels:
- traefik.enable=false
# after firsh start need run
# cd $INSTALLPATH && docker-compose exec sentry sentry upgrade
# for run migration and setup admin user\passwd
sentry:
image: sentry:9
hostname: sentry
restart: always
links:
- sentry-redis
- sentry-postgres
command: "sentry run web -w 4"
ports:
- "9000:9000"
env_file:
- ./data/sentry/sentry.env
logging:
driver: $COMPOSE_LOG_DRIVER
options:
max-size: $COMPOSE_LOG_MAX_SIZE
max-file: $COMPOSE_LOG_MAX_FILE
labels:
- traefik.enable=false
ulimits:
nproc: 65535
nofile:
soft: 20000
hard: 40000
sentry-cron:
image: sentry:9
hostname: sentry-cron
restart: always
links:
- sentry-redis
- sentry-postgres
command: "sentry run cron"
env_file:
- ./data/sentry/sentry.env
logging:
driver: $COMPOSE_LOG_DRIVER
options:
max-size: $COMPOSE_LOG_MAX_SIZE
max-file: $COMPOSE_LOG_MAX_FILE
labels:
- traefik.enable=false
sentry-worker:
image: sentry:9
hostname: sentry-worker
restart: always
links:
- sentry-redis
- sentry-postgres
command: "sentry run worker"
env_file:
- ./data/sentry/sentry.env
logging:
driver: $COMPOSE_LOG_DRIVER
options:
max-size: $COMPOSE_LOG_MAX_SIZE
max-file: $COMPOSE_LOG_MAX_FILE
labels:
- traefik.enable=false