-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
54 lines (49 loc) · 1.35 KB
/
docker-compose.yaml
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
version: '3.8'
services:
prometheus:
image: prom/prometheus:latest
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--web.config.file=/etc/prometheus/web.yml'
- '--storage.tsdb.retention=720h'
# allow hot-reload of config
- '--web.enable-lifecycle'
ports:
- "39090:9090"
volumes:
- ./prometheus:/etc/prometheus:ro
- prometheus_data:/prometheus
- ./prom.auth:/etc/self.auth:ro
depends_on:
- cadvisor
restart: unless-stopped
grafana:
build: './grafana'
depends_on:
- prometheus
ports:
- '3000:3000'
volumes:
- ./grafana/dashboards:/var/lib/grafana/dashboards
restart: unless-stopped
# Local container-wise metrics
# https://medium.com/@bhargavshah2011/monitoring-docker-containers-using-cadvisor-and-prometheus-5350ae038f45
cadvisor:
image: gcr.io/cadvisor/cadvisor:latest
command:
- "-http_auth_file=/opt/creds.auth"
- "-storage_duration=5m0s"
privileged: true
# Enable to expose these metrics directly and externally
ports:
- 34080:8080
volumes:
- /:/rootfs:ro
- /var/run:/var/run:ro
- /sys:/sys:ro
- /var/lib/docker/:/var/lib/docker:ro
- /dev/disk/:/dev/disk:ro
- ./cadvisor.auth:/opt/creds.auth
restart: unless-stopped
volumes:
prometheus_data: {}