-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdocker-compose.yml
75 lines (75 loc) · 2.02 KB
/
docker-compose.yml
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
# Define volumes for images to persist data to
volumes:
portainer_data:
prometheus_data:
grafana_data:
# Use the shared network across all stacks
networks:
anton-net:
external: true
services:
portainer:
image: portainer/portainer-ce:latest
container_name: portainer
restart: unless-stopped
security_opt:
- no-new-privileges:true
volumes:
- "/etc/localtime:/etc/localtime:ro"
- "/var/run/docker.sock:/var/run/docker.sock:ro"
- "portainer_data:/data"
ports:
- "9000:9000"
networks:
- anton-net
prometheus:
image: prom/prometheus:latest
container_name: prometheus
restart: unless-stopped
volumes:
- "prometheus_data:/prometheus"
- "./prometheus.yml:/prometheus.yml"
command:
- "--config.file=/prometheus.yml"
- "--storage.tsdb.path=/prometheus"
ports:
- "9090:9090"
networks:
- anton-net
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"
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"
deploy:
mode: global
networks:
- anton-net
grafana:
image: grafana/grafana:latest
user: 0:0
container_name: grafana
ports:
- "6150:3000"
volumes:
- "grafana_data:/var/lib/grafana"
- "./grafana/provisioning:/etc/grafana/provisioning"
- "./grafana/dashboards:/etc/grafana/provisioning_temp/dashboards"
networks:
- anton-net
depends_on:
- prometheus
entrypoint: >
sh -c "cp -r /etc/grafana/provisioning_temp/dashboards/. /etc/grafana/provisioning/dashboards &&
find /etc/grafana/provisioning/dashboards/ -name '*.json' -exec sed -i 's/$${DS_PROMETHEUS}/Prometheus/g' {} \+ &&
/run.sh"