-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
279 lines (270 loc) · 7.07 KB
/
docker-compose.yml
File metadata and controls
279 lines (270 loc) · 7.07 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
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
services:
# -----------------------------
# Prometheus - Metrics
# -----------------------------
prometheus:
image: prom/prometheus:v3.2.1
container_name: prometheus
ports:
- "9090:9090"
volumes:
- ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro
- ./prometheus/alert.rules.yml:/etc/prometheus/alert.rules.yml:ro
- prometheus-data:/prometheus
command:
- --config.file=/etc/prometheus/prometheus.yml
- --web.enable-lifecycle
- --web.enable-remote-write-receiver
depends_on:
alertmanager:
condition: service_healthy
restart: unless-stopped
deploy:
resources:
limits:
memory: 2g
reservations:
memory: 256m
healthcheck:
test:
[
"CMD-SHELL",
"wget --spider -q http://prometheus:9090/-/ready || exit 1",
]
interval: 10s
timeout: 5s
retries: 5
# -----------------------------
# Alertmanager - Alerts
# -----------------------------
alertmanager:
image: prom/alertmanager:v0.28.1
container_name: alertmanager
ports:
- "9093:9093"
volumes:
- ./alertmanager/alertmanager.yml:/etc/alertmanager/alertmanager.yml:ro
- alertmanager-data:/alertmanager
command: ["--config.file=/etc/alertmanager/alertmanager.yml"]
restart: unless-stopped
deploy:
resources:
limits:
memory: 256m
reservations:
memory: 64m
healthcheck:
test:
[
"CMD-SHELL",
"wget --spider -q http://alertmanager:9093/-/ready || exit 1",
]
interval: 10s
timeout: 5s
retries: 5
# -----------------------------
# Grafana - Dashboards / Visualization
# -----------------------------
grafana:
image: grafana/grafana:11.5.2
container_name: grafana
ports:
- "3030:3000"
environment:
GF_SECURITY_ADMIN_USER: ${GF_SECURITY_ADMIN_USER:-admin}
GF_SECURITY_ADMIN_PASSWORD: ${GF_SECURITY_ADMIN_PASSWORD:?GF_SECURITY_ADMIN_PASSWORD must be set in .env}
GF_LOG_LEVEL: info
depends_on:
- prometheus
volumes:
- grafana-storage:/var/lib/grafana
- ./grafana/provisioning/datasources:/etc/grafana/provisioning/datasources:ro
- ./grafana/provisioning/dashboards:/etc/grafana/provisioning/dashboards:ro
- ./grafana/dashboards:/var/lib/grafana/dashboards:ro
restart: unless-stopped
deploy:
resources:
limits:
memory: 512m
reservations:
memory: 128m
healthcheck:
test:
[
"CMD-SHELL",
"wget --spider -q http://grafana:3000/api/health || exit 1",
]
interval: 10s
timeout: 5s
retries: 5
# -----------------------------
# Loki - Logs aggregation
# -----------------------------
loki:
image: grafana/loki:2.8.2
container_name: loki
ports:
- "3100:3100"
user: "10001:10001"
command:
- -config.file=/etc/loki/loki-config.yaml
volumes:
- ./loki/loki-config.yaml:/etc/loki/loki-config.yaml:ro
- loki-index:/loki/index
- loki-cache:/loki/cache
- loki-chunks:/loki/chunks
- loki-wal:/loki/wal
- loki-compactor:/loki/compactor
restart: unless-stopped
deploy:
resources:
limits:
memory: 1g
reservations:
memory: 128m
healthcheck:
test: ["CMD-SHELL", "wget --spider -q http://loki:3100/ready || exit 1"]
interval: 10s
timeout: 5s
retries: 5
# -----------------------------
# Promtail - Log collection
# -----------------------------
promtail:
image: grafana/promtail:2.8.2
container_name: promtail
volumes:
- ./promtail/promtail-config.yaml:/etc/promtail/config.yaml:ro
- /var/log:/var/log:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
- promtail-positions:/var/lib/promtail
command:
- -config.file=/etc/promtail/config.yaml
depends_on:
loki:
condition: service_healthy
restart: unless-stopped
deploy:
resources:
limits:
memory: 256m
reservations:
memory: 64m
# -----------------------------
# Tempo - Traces aggregation
# -----------------------------
tempo:
image: grafana/tempo:2.5.0
container_name: tempo
ports:
- "3200:3200" # HTTP API/Query
- "4320:4320" # Internal gRPC (server port)
- "4318:4318" # OTLP gRPC receiver (for receiving traces)
- "4319:4319" # OTLP HTTP receiver
user: "10001:10001"
volumes:
- ./tempo/tempo-config.yaml:/etc/tempo/tempo-config.yaml:ro
- tempo-data:/tempo-data
command:
- -config.file=/etc/tempo/tempo-config.yaml
restart: unless-stopped
deploy:
resources:
limits:
memory: 1g
reservations:
memory: 128m
healthcheck:
test: ["CMD-SHELL", "wget --spider -q http://tempo:3200/ready || exit 1"]
interval: 10s
timeout: 5s
retries: 5
# -----------------------------
# IRC relay - Alert notifications
# -----------------------------
irc-relay:
build:
context: ./irc-deamon
dockerfile: Dockerfile.irc
container_name: irc-relay
ports:
- "8010:8010"
environment:
IRC_NICKSERV_PASS: ${IRC_NICKSERV_PASS:-}
volumes:
- ./irc-deamon/config.yml:/etc/alertmanager-irc-relay/config.yml:ro
restart: unless-stopped
depends_on:
- alertmanager
deploy:
resources:
limits:
memory: 64m
reservations:
memory: 16m
# -----------------------------
# Ollama - Local LLM inference (optional, profile: llm)
# -----------------------------
ollama:
image: ollama/ollama:0.6.5
container_name: ollama
profiles: [llm]
ports:
- "11434:11434"
volumes:
- ollama-data:/root/.ollama
restart: unless-stopped
deploy:
resources:
limits:
memory: 8g
reservations:
memory: 1g
healthcheck:
test: ["CMD-SHELL", "curl -sf http://localhost:11434/api/tags || exit 1"]
interval: 15s
timeout: 5s
retries: 5
# -----------------------------
# IRC Bot - LLM alert analysis (optional, profile: llm)
# -----------------------------
irc-bot:
build:
context: ./irc-bot
container_name: irc-bot
profiles: [llm]
environment:
IRC_HOST: "irc.wetfish.net"
IRC_PORT: "6697"
IRC_USE_TLS: "true"
IRC_NICK: "fishvision"
IRC_NICKSERV_PASS: ${IRC_NICKSERV_PASS:-}
IRC_CHANNEL: "#alerts"
ALERT_BOT_NICK: "alertbot"
OLLAMA_URL: "http://ollama:11434"
OLLAMA_MODEL: "qwen2.5:3b"
GRAFANA_URL: "http://grafana:3000"
restart: unless-stopped
depends_on:
- irc-relay
- prometheus
- loki
- tempo
deploy:
resources:
limits:
memory: 256m
reservations:
memory: 64m
volumes:
prometheus-data:
alertmanager-data:
grafana-storage:
tempo-data:
loki-index:
loki-cache:
loki-chunks:
loki-wal:
loki-compactor:
promtail-positions:
ollama-data: