-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
124 lines (113 loc) · 3.12 KB
/
docker-compose.yaml
File metadata and controls
124 lines (113 loc) · 3.12 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
networks:
app:
volumes:
loki_data:
prometheus_data:
grafana_data:
alloy_data:
services:
# Loki (Log Aggregation Store)
loki:
image: grafana/loki:2.9.2
ports:
- "3100:3100"
command: -config.file=/etc/loki/local-config.yaml
volumes:
- ./loki/local-config.yaml:/etc/loki/local-config.yaml
- loki_data:/loki
networks:
- app
# Grafana Alloy (The new Log Collector)
alloy:
image: grafana/alloy:latest
volumes:
# Rootless docker socket mapped inside the VM
- /run/user/1000/docker.sock:/var/run/docker.sock:ro
- ./alloy/config.alloy:/etc/alloy/config.alloy
- /var/log:/var/log:ro # Mount host logs (optional)
- alloy_data:/var/lib/alloy/data
command:
- run
- --server.http.listen-addr=0.0.0.0:12345
- --storage.path=/var/lib/alloy/data
- /etc/alloy/config.alloy
ports:
- "12345:12345" # Alloy UI (very useful for debugging!)
networks:
- app
# Prometheus (Metric Collector)
prometheus:
image: prom/prometheus:latest
ports:
- "9090:9090"
volumes:
- ./prometheus/prometheus.yaml:/etc/prometheus/prometheus.yaml
- prometheus_data:/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yaml'
- '--storage.tsdb.path=/prometheus'
- '--storage.tsdb.retention.time=7d'
networks:
- app
# Grafana (Visualisation UI)
grafana:
# build custom image to replace the logo
build:
context: ./grafana
dockerfile: Dockerfile
volumes:
- grafana_data:/var/lib/grafana
# provisioning
- ./grafana/provisioning/datasources:/etc/grafana/provisioning/datasources
- ./grafana/provisioning/dashboards:/etc/grafana/provisioning/dashboards
- ./grafana/dashboards:/var/lib/grafana/dashboards
environment:
- GF_PATHS_PROVISIONING=/etc/grafana/provisioning
- GF_PATHS_DATA=/var/lib/grafana
- GF_PATHS_LOGS=/var/lib/grafana/logs
- GF_PATHS_PLUGINS=/var/lib/grafana/plugins
- GF_AUTH_ANONYMOUS_ENABLED=false # Set to true to skip login
- GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
ports:
- "3000:3000"
networks:
- app
# Node Exporter (Hardware/OS metrics)
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
- /run/udev/data:/run/udev/data: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"
networks:
- app
# Flog (Fake Log Generator for demo data)
flog:
image: mingrammer/flog
deploy:
# Only add FLOG when the number of replicas is greater than 0
replicas: ${FLOG_COUNT:-1}
command: -f json -d 1s -l
networks:
- app
# TODO next:
# - blackbox
# - alertmanager
# TODO after next:
# - Speedtest
# Maybe TODO:
# - Process Exporter
# TODO After all:
# - mongodb
# - neo4j
# - postgres