-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
110 lines (103 loc) · 3.09 KB
/
Copy pathdocker-compose.yml
File metadata and controls
110 lines (103 loc) · 3.09 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
version: '3.8'
services:
prometheus:
image: prom/prometheus:latest
ports:
- "127.0.0.1:${PROMETHEUS_PORT:-9090}:9090" # Bind only to localhost for security
volumes:
- "./prometheus.yml:/etc/prometheus/prometheus.yml:ro"
- "prometheus_data:/prometheus"
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--storage.tsdb.retention.time=30d'
- '--web.enable-lifecycle'
- '--web.enable-admin-api'
restart: unless-stopped
networks: [monitoring]
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:9090/-/healthy"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
grafana:
image: grafana/grafana:latest
ports:
- "127.0.0.1:${GRAFANA_PORT:-3000}:3000" # Bind only to localhost
environment:
- GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD}
- GF_USERS_ALLOW_SIGN_UP=false
- GF_SECURITY_DISABLE_GRAVATAR=true
- GF_ANALYTICS_REPORTING_ENABLED=false
- GF_ANALYTICS_CHECK_FOR_UPDATES=false
- GF_SECURITY_COOKIE_SECURE=true
- GF_SECURITY_COOKIE_SAMESITE=strict
- GF_SERVER_SERVE_FROM_SUB_PATH=false
volumes:
- "grafana_data:/var/lib/grafana"
- "./grafana/provisioning:/etc/grafana/provisioning:ro"
- "./grafana/dashboards:/var/lib/grafana/dashboards:ro"
depends_on:
prometheus:
condition: service_healthy
restart: unless-stopped
networks: [monitoring]
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:3000/api/health || exit 1"]
interval: 30s
timeout: 10s
retries: 3
start_period: 20s
node-exporter:
image: prom/node-exporter:latest
ports:
- "127.0.0.1:${NODE_EXPORTER_PORT:-9100}:9100"
restart: unless-stopped
networks: [monitoring]
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /:/rootfs:ro
command:
- '--path.procfs=/host/proc'
- '--path.rootfs=/rootfs'
- '--path.sysfs=/host/sys'
- '--collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($$|/)'
pid: host
cadvisor:
image: gcr.io/cadvisor/cadvisor:latest
ports:
- "127.0.0.1:${CADVISOR_PORT:-8080}:8080"
volumes:
- "/:/rootfs:ro"
- "/var/run:/var/run:ro"
- "/sys:/sys:ro"
- "/var/lib/docker/:/var/lib/docker:ro"
- "/dev/disk/:/dev/disk:ro"
restart: unless-stopped
networks: [monitoring]
privileged: true
devices:
- "/dev/kmsg"
blackbox-exporter:
image: prom/blackbox-exporter:latest
ports:
- "127.0.0.1:${BLACKBOX_PORT:-9115}:9115"
volumes:
- "./blackbox.yml:/etc/blackbox_exporter/config.yml:ro"
restart: unless-stopped
networks: [monitoring]
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:9115/-/healthy"]
interval: 30s
timeout: 10s
retries: 3
volumes:
prometheus_data:
driver: local
grafana_data:
driver: local
networks:
monitoring:
driver: bridge