-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
229 lines (218 loc) · 5.98 KB
/
docker-compose.yaml
File metadata and controls
229 lines (218 loc) · 5.98 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
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
services:
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: backend
ports:
- "8000:8000"
labels:
metrics.scrape: "true"
environment:
APP_NAME: backend
LOG_LEVEL: INFO
PYROSCOPE_HOST: alloy
PYROSCOPE_PORT: 4040
OTLP_HOST: alloy
OTLP_PORT: 4317
PROMETHEUS_MULTIPROC_DIR: /tmp/prometheus-metrics
GUNICORN_WORKERS: 2
volumes:
- backend_prometheus_metrics:/tmp/prometheus-metrics
healthcheck:
test: [ "CMD-SHELL", "curl -sf http://localhost:8000/health || exit 1" ]
start_period: 30s
interval: 10s
timeout: 3s
retries: 3
depends_on:
alloy:
condition: service_started
networks:
- observability_network
victoriametrics:
image: victoriametrics/victoria-metrics:v1.131.0
container_name: victoriametrics
volumes:
- victoriametrics_data:/storage
command:
- -storageDataPath=/storage
- -httpListenAddr=:8428
- -graphiteListenAddr=:2003
- -opentsdbListenAddr=:4242
- -influxListenAddr=:8089
- -envflag.enable=true
- -envflag.prefix=VM_
- -loggerFormat=json
- -enableTCP6
environment:
VM_retentionPeriod: 12
VM_search_maxUniqueTimeseries: 1000000
healthcheck:
test: [ "CMD-SHELL", "wget --quiet --tries=1 --spider http://127.0.0.1:8428/health || exit 1" ]
start_period: 5s
interval: 30s
timeout: 3s
retries: 3
networks:
- observability_network
vmalert:
image: victoriametrics/vmalert:v1.131.0
container_name: vmalert
healthcheck:
test: [ "CMD-SHELL", "wget --quiet --tries=1 --spider http://127.0.0.1:8880/health || exit 1" ]
start_period: 3s
interval: 30s
timeout: 3s
retries: 3
depends_on:
victoriametrics:
condition: service_healthy
alertmanager:
condition: service_healthy
volumes:
- ./observability/vmalert/rules:/etc/rules
command:
- '--datasource.url=http://victoriametrics:8428'
- '--remoteRead.url=http://victoriametrics:8428'
- '--remoteWrite.url=http://victoriametrics:8428'
- '--notifier.url=http://alertmanager:9093'
- '--rule=/etc/rules/*.yaml'
networks:
- observability_network
alertmanager:
image: prom/alertmanager:v0.29.0
container_name: alertmanager
volumes:
- ./observability/alertmanager/:/etc/alertmanager/
command:
- '--config.file=/etc/alertmanager/config.yaml'
- '--storage.path=/alertmanager'
healthcheck:
test: [ "CMD-SHELL", "wget --quiet --tries=1 --spider http://127.0.0.1:9093/-/healthy || exit 1" ]
start_period: 3s
interval: 30s
timeout: 3s
retries: 3
networks:
- observability_network
dns:
- 8.8.8.8
- 8.8.4.4
alloy:
image: grafana/alloy:v1.12.0
container_name: alloy
privileged: true
ports:
- "12345:12345"
environment:
ALLOY_DEPLOY_MODE: docker
volumes:
- ./observability/alloy:/etc/alloy
- /proc:/rootproc:ro
- /var/run/docker.sock:/var/run/docker.sock
- /sys:/sys:ro
- /:/rootfs:ro
- /dev/disk/:/dev/disk:ro
- /var/lib/docker/:/var/lib/docker:ro
command: run --server.http.listen-addr=0.0.0.0:12345 --storage.path=/var/lib/alloy/data /etc/alloy/config.alloy
extra_hosts:
- "host.docker.internal:host-gateway"
devices:
- /dev/kmsg
depends_on:
victoriametrics:
condition: service_healthy
loki:
condition: service_healthy
tempo:
condition: service_healthy
networks:
- observability_network
loki:
# healthcheck broken in 3.6.0: https://github.com/grafana/loki/issues/19923
image: grafana/loki:3.5.9
container_name: loki
user: root
command:
- "-config.file=/etc/loki/config.yaml"
- "-config.expand-env=true"
volumes:
- loki_data:/loki
- ./observability/loki/config.yaml:/etc/loki/config.yaml
healthcheck:
test: [ "CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:3100/ready || exit 1" ]
start_period: 30s
interval: 30s
timeout: 3s
retries: 3
networks:
- observability_network
grafana:
image: grafana/grafana:12.4.0-20082909961-ubuntu
container_name: grafana
user: root
ports:
- "3000:3000"
volumes:
- grafana_data:/var/lib/grafana
- ./observability/grafana/provisioning/:/etc/grafana/provisioning/
environment:
- GF_SECURITY_ADMIN_USER=${GF_ADMIN_USER:-admin}
- GF_SECURITY_ADMIN_PASSWORD=${GF_ADMIN_PASSWORD:-admin}
- GF_USERS_ALLOW_SIGN_UP=false
healthcheck:
test: [ "CMD-SHELL", "curl -s -f http://localhost:3000/api/health || exit 1" ]
start_period: 3s
interval: 30s
timeout: 3s
retries: 3
depends_on:
victoriametrics:
condition: service_healthy
loki:
condition: service_healthy
alertmanager:
condition: service_healthy
tempo:
condition: service_healthy
networks:
- observability_network
dns:
- 8.8.8.8
- 8.8.4.4
pyroscope:
container_name: pyroscope
image: grafana/pyroscope:1.17.0
command:
- "server"
volumes:
- pyroscope_data:/var/lib/pyroscope
networks:
- observability_network
tempo:
image: grafana/tempo:2.8.0
container_name: tempo
command:
- "-config.file=/etc/tempo/config.yaml"
volumes:
- ./observability/tempo/config.yaml:/etc/tempo/config.yaml
- tempo_data:/var/tempo
healthcheck:
test: [ "CMD", "/busybox/wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3200/ready" ]
start_period: 10s
interval: 30s
timeout: 3s
retries: 3
networks:
- observability_network
networks:
observability_network:
driver: bridge
volumes:
loki_data:
grafana_data:
victoriametrics_data:
pyroscope_data:
tempo_data:
backend_prometheus_metrics: