-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
190 lines (151 loc) · 3.7 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
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
182
183
184
185
186
187
188
189
190
version: '3.9'
services:
blackboxexporter:
image: prom/blackbox-exporter:v0.25.0
container_name: hostmon__blackboxexporter
hostname: blackboxexporter
restart: unless-stopped
volumes:
- type: bind
source: ./blackbox-exporter.yml
target: /etc/blackbox_exporter/config.yml
read_only: true
networks:
- default
deploy:
resources:
limits:
memory: 128m
nodeexporter:
image: prom/node-exporter:v1.8.1
container_name: hostmon__nodeexporter
hostname: nodeexporter
restart: unless-stopped
volumes:
- type: bind
source: /
target: /rootfs
read_only: true
bind:
propagation: rslave
command:
- '--path.rootfs=/rootfs'
networks:
- default
deploy:
resources:
limits:
memory: 128m
cadvisor:
image: gcr.io/cadvisor/cadvisor:v0.49.1
container_name: hostmon__cadvisor
hostname: cadvisor
restart: unless-stopped
volumes:
- type: bind
source: /
target: /rootfs
read_only: true
- type: bind
source: /var/run
target: /var/run
read_only: true
- type: bind
source: /sys
target: /sys
read_only: true
- type: bind
source: /var/lib/docker
target: /var/lib/docker
read_only: true
- type: bind
source: /dev/disk
target: /dev/disk
read_only: true
privileged: true
devices:
- /dev/kmsg:/dev/kmsg
networks:
- default
deploy:
resources:
limits:
memory: 1024m
prometheus:
image: prom/prometheus:v2.53.1
hostname: prometheus
container_name: hostmon__prometheus
restart: unless-stopped
volumes:
- type: bind
source: ./prometheus.yml
target: /etc/prometheus/prometheus.yml
read_only: true
- type: volume
source: prometheus_data
target: /prometheus
environment:
HOSTNAME: ${HOSTNAME}
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.retention.time=7d'
- '--storage.tsdb.path=/prometheus'
- '--web.console.libraries=/etc/prometheus/console_libraries'
- '--web.console.templates=/etc/prometheus/consoles'
- '--enable-feature=expand-external-labels'
networks:
- default
deploy:
resources:
limits:
memory: 2048m
nginx:
image: nginx:1.27.0
hostname: nginx
container_name: hostmon__nginx
restart: unless-stopped
environment:
CF_ACCESS_CLIENT_ID: ${CF_ACCESS_CLIENT_ID}
CF_ACCESS_CLIENT_SECRET: ${CF_ACCESS_CLIENT_SECRET}
volumes:
- type: bind
source: ./default.conf
target: /etc/nginx/templates/default.conf.template
read_only: true
deploy:
resources:
limits:
memory: 128m
networks:
- default
grafana:
image: grafana/grafana-oss:11.1.0
container_name: hostmon__grafana
restart: unless-stopped
hostname: grafana
ports:
- 3000:3000
environment:
GF_SECURITY_ADMIN_USER: ${GF_ADMIN_USER:-admin}
GF_SECURITY_ADMIN_PASSWORD: ${GF_ADMIN_PASSWORD:-password}
GF_USERS_ALLOW_SIGN_UP: "false"
GF_USERS_ALLOW_ORG_CREATE: "false"
GF_AUTH_ANONYMOUS_ENABLED: "true"
volumes:
- type: volume
source: grafana_data
target: /var/lib/grafana
deploy:
resources:
limits:
memory: 512m
networks:
- default
networks:
default:
name: hostmon__default
volumes:
prometheus_data:
name: hostmon__prometheus_data
grafana_data:
name: hostmon__grafana_data