Repository navigation
Expand file tree
/
Copy pathcompose.yaml
More file actions
143 lines (128 loc) · 3.28 KB
/
Copy pathcompose.yaml
File metadata and controls
143 lines (128 loc) · 3.28 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
---
services:
web:
image: nginx:1.27-alpine
container_name: nginx
restart: unless-stopped
networks:
- monitoring
ports:
- "8080:80"
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./nginx/html/:/usr/share/nginx/html:ro
depends_on:
grafana:
condition: service_healthy
prometheus:
condition: service_healthy
healthcheck:
test: ["CMD", "wget", "-q", "--spider", "http://localhost:80/"]
interval: 30s
timeout: 5s
retries: 3
start_period: 10s
grafana:
image: grafana/grafana-oss:latest
container_name: grafana
healthcheck:
test: ["CMD-SHELL", "wget -qO- http://localhost:3000/api/health || exit 1"]
interval: 30s
timeout: 5s
retries: 3
start_period: 30s
restart: unless-stopped
environment:
- GF_SERVER_ROOT_URL=http://localhost:8080/grafana/
- GF_SERVER_SERVE_FROM_SUB_PATH=true
networks:
- monitoring
ports:
- "3000:3000"
volumes:
- grafana-data:/var/lib/grafana
prometheus:
image: prom/prometheus
container_name: prometheus
healthcheck:
test: ["CMD-SHELL", "wget --quiet --tries=1 --spider http://localhost:9090/-/healthy"]
interval: 30s
timeout: 10s
retries: 3
start_period: 20s
restart: unless-stopped
networks:
- monitoring
ports:
- "9090:9090"
command:
- "--config.file=/etc/prometheus/prometheus.yaml"
- "--web.external-url=http://localhost:8080/prometheus/"
- "--web.route-prefix=/"
volumes:
- ./prometheus/prometheus.yaml:/etc/prometheus/prometheus.yaml:ro
- prometheus-data:/prometheus
node-exporter:
image: prom/node-exporter
container_name: node-exporter
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "wget -q --spider http://localhost:9100/metrics || exit 1"]
interval: 30s
timeout: 5s
retries: 3
start_period: 10s
networks:
- monitoring
ports:
- "9100:9100"
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /:/rootfs:ro
command:
- '--path.procfs=/host/proc'
- '--path.rootfs=/rootfs'
- '--path.sysfs=/host/sys'
cadvisor:
image: gcr.io/cadvisor/cadvisor:latest
container_name: cadvisor
healthcheck:
test: ["CMD-SHELL", "wget -q --spider http://localhost:8080/ || exit 1"]
interval: 30s
timeout: 5s
retries: 3
start_period: 20s
restart: unless-stopped
networks:
- monitoring
ports:
- "8081:8080"
volumes:
- /:/rootfs:ro
- /var/run:/var/run:rw
- /sys:/sys:ro
- /var/lib/docker/:/var/lib/docker:ro
- /dev/disk:/dev/disk:ro
portainer:
image: portainer/portainer-ce:lts
container_name: portainer
restart: always
networks:
- monitoring
ports:
- "9443:9443"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- portainer_data:/data
# - 8000:8000 # Remove if you do not intend to use Edge Agents
volumes:
grafana-data:
name: grafana_data
prometheus-data:
name: prometheus_data
portainer_data:
name: portainer_data
networks:
monitoring:
name: monitoring