-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
181 lines (171 loc) · 5.18 KB
/
docker-compose.yml
File metadata and controls
181 lines (171 loc) · 5.18 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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
version: "3.8"
services:
prometheus:
image: prom/prometheus:latest
container_name: prometheus
restart: unless-stopped
networks:
- monitoring
environment:
- HOSTNAME_MONITOR=${HOSTNAME_MONITOR}
volumes:
- ./data/prometheus:/prometheus
- ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro
- ./prometheus/rules.yml:/etc/prometheus/rules.yml:ro
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.enable-lifecycle'
- '--web.external-url=https://${HOSTNAME_MONITOR}/prometheus'
- '--web.route-prefix=/prometheus'
healthcheck:
test: ["CMD", "wget", "--spider", "-q", "http://localhost:9090/-/ready || exit 1"]
interval: 30s
timeout: 5s
retries: 5
deploy:
resources:
limits:
memory: 1g
alertmanager:
image: prom/alertmanager:latest
container_name: alertmanager
restart: unless-stopped
networks:
- monitoring
env_file:
- .env
environment:
- HOSTNAME_MONITOR=${HOSTNAME_MONITOR}
volumes:
- ./data/alertmanager:/alertmanager
- ./alertmanager/alertmanager.yml:/etc/alertmanager/alertmanager.yml:ro
command:
- '--config.file=/etc/alertmanager/alertmanager.yml'
- '--web.external-url=https://${HOSTNAME_MONITOR}/alertmanager'
- '--web.route-prefix=/alertmanager'
healthcheck:
test: ["CMD", "wget", "--spider", "-q", "http://localhost:9093/-/ready || exit 1"]
interval: 30s
timeout: 5s
retries: 5
deploy:
resources:
limits:
memory: 512m
grafana:
image: grafana/grafana:latest
container_name: grafana
user: "472:472"
restart: unless-stopped
networks:
- monitoring
env_file:
- .env
environment:
- GF_SECURITY_ADMIN_USER=${GF_SECURITY_ADMIN_USER}
- GF_SECURITY_ADMIN_PASSWORD=${GF_SECURITY_ADMIN_PASSWORD}
- GF_AUTH_ANONYMOUS_ENABLED=false
- GF_SERVER_ROOT_URL=%(protocol)s://%(domain)s/grafana/
- GF_PATHS_PROVISIONING=/etc/grafana/provisioning
- GF_LOG_LEVEL=debug
volumes:
- ./data/grafana:/var/lib/grafana
# 🧩 Fixed: Proper provisioning structure
- ./grafana/provisioning/datasources:/etc/grafana/provisioning/datasources:ro
- ./grafana/provisioning/dashboards:/etc/grafana/provisioning/dashboards:ro
- ./grafana/dashboards:/var/lib/grafana/dashboards:ro
depends_on:
- prometheus
healthcheck:
test: ["CMD", "wget", "--spider", "-q", "http://localhost:3000/api/health || exit 1"]
interval: 30s
timeout: 5s
retries: 5
deploy:
resources:
limits:
memory: 1g
node-exporter:
image: prom/node-exporter:latest
container_name: node-exporter
restart: unless-stopped
network_mode: host
pid: host
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /:/host:ro
node-exporter-proxy:
image: alpine/socat
container_name: node-exporter-proxy
restart: unless-stopped
command: tcp-listen:9100,fork,reuseaddr tcp-connect:host.docker.internal:9100
networks:
- monitoring
extra_hosts:
- "host.docker.internal:host-gateway"
cadvisor:
image: gcr.io/cadvisor/cadvisor:latest
container_name: cadvisor
restart: unless-stopped
networks:
- monitoring
volumes:
- /:/rootfs:ro
- /var/run:/var/run:rw
- /sys:/sys:ro
- /var/lib/docker/:/var/lib/docker:ro
- /dev/disk/:/dev/disk:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
deploy:
resources:
limits:
memory: 512m
blackbox-exporter:
image: prom/blackbox-exporter:latest
container_name: blackbox-exporter
restart: unless-stopped
networks:
- monitoring
environment:
- HOSTNAME_MONITOR=${HOSTNAME_MONITOR}
volumes:
- ./blackbox-exporter/blackbox.yml:/etc/blackbox_exporter/config.yml:ro
command:
- '--config.file=/etc/blackbox_exporter/config.yml'
- '--web.external-url=https://${HOSTNAME_MONITOR}/blackbox'
- '--web.route-prefix=/blackbox'
healthcheck:
test: ["CMD", "wget", "--spider", "-q", "http://localhost:9115/ || exit 1"]
interval: 30s
timeout: 5s
retries: 5
nginx:
image: nginx:stable-alpine
container_name: nginx-proxy
restart: unless-stopped
networks:
- monitoring
ports:
- "${LISTEN_PORT}:443"
environment:
- HOSTNAME_MONITOR=${HOSTNAME_MONITOR}
- USE_TLS=${USE_TLS}
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./nginx/conf.d/monitoring.conf:/etc/nginx/conf.d/monitoring.conf:ro
- ./nginx/auth:/etc/nginx/auth:ro
- ./secrets:/run/secrets:ro
depends_on:
- prometheus
- grafana
- alertmanager
healthcheck:
test: ["CMD", "wget", "--spider", "-q", "http://localhost/health || exit 1"]
interval: 15s
timeout: 3s
retries: 3
networks:
monitoring:
driver: bridge