-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
193 lines (181 loc) · 5.75 KB
/
Copy pathdocker-compose.yaml
File metadata and controls
193 lines (181 loc) · 5.75 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
182
183
184
185
186
187
188
189
190
191
192
193
# Monitoring stack for `container compose`.
#
# `container compose up -d` starts the self-contained dashboard, metrics, and
# proxy services. The original host-observability collectors remain available
# under the `linux-host` profile. They require a Linux Docker host with the
# listed host paths and cannot collect macOS host metrics through Apple's
# container runtime.
networks:
monitoring:
name: monitoring
driver: bridge
services:
nginx:
image: nginx:1.28.3-alpine
container_name: nginx
ports:
- "8080:80"
labels:
- logging=promtail
volumes:
- ./nginx/conf.d:/etc/nginx/conf.d:ro
# This project-scoped volume makes the repeated-up demonstration prove
# that Compose retains and reuses runtime resources across a down that
# intentionally omits --volumes.
- nginx_cache:/var/cache/nginx
extra_hosts: ["host.docker.internal:host-gateway"]
networks: [monitoring]
restart: unless-stopped
promtail:
image: grafana/alloy:v1.17.1
container_name: promtail
profiles: [linux-host]
environment:
- HOST_LABEL=${MONITORING_HOSTNAME:-example-host}
command:
- run
- --stability.level=public-preview
- --storage.path=/var/lib/promtail
- --server.http.listen-addr=0.0.0.0:9080
- /etc/alloy/config.alloy
volumes:
- ./promtail/alloy-config.alloy:/etc/alloy/config.alloy:ro
- /var/log:/var/log:ro
- /var/lib/docker:/var/lib/docker:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
- promtail_positions:/var/lib/promtail
- /var/log/journal:/var/log/journal:ro
- /run/log/journal:/run/log/journal:ro
- /etc/machine-id:/etc/machine-id:ro
- /var/lib/systemd:/var/lib/systemd:ro
extra_hosts: ["host.docker.internal:host-gateway"]
networks: [monitoring]
restart: unless-stopped
cadvisor:
image: ghcr.io/google/cadvisor:v0.60.5
container_name: cadvisor
labels:
- logging=promtail
ports:
- "9105:8080"
# cAdvisor can run in the Linux guest and report its VM-local system
# metrics. Docker-host mounts are intentionally omitted: Apple container
# does not expose a Docker socket or the macOS host's Linux cgroups.
networks: [monitoring]
restart: unless-stopped
node-exporter:
image: quay.io/prometheus/node-exporter:v1.12.1
container_name: node-exporter
profiles: [linux-host]
restart: unless-stopped
network_mode: host
pid: host
command:
- --web.listen-address=:9100
- --path.rootfs=/host/root
- --path.procfs=/host/proc
- --path.sysfs=/host/sys
labels:
- logging=promtail
volumes:
- /:/host/root:ro,rslave
- /proc:/host/proc:ro
- /sys:/host/sys:ro
pushgateway:
image: prom/pushgateway:v1.11.3
container_name: pushgateway
command:
- --web.listen-address=:9091
- --persistence.file=/var/lib/pushgateway/metrics.db
- --persistence.interval=30s
labels:
- logging=promtail
ports:
- "9091:9091"
networks: [monitoring]
restart: unless-stopped
alertmanager:
image: prom/alertmanager:v0.33.1
container_name: alertmanager
command:
- --config.file=/etc/alertmanager/alertmanager.yaml
- --storage.path=/alertmanager
- --web.route-prefix=/alertmanager
- --web.external-url=http://${MONITORING_HOST:-localhost:8080}/alertmanager
ports:
- "9093:9093"
labels:
- logging=promtail
volumes:
- ./alertmanager/alertmanager.yaml:/etc/alertmanager/alertmanager.yaml:ro
networks: [monitoring]
restart: unless-stopped
prometheus:
image: prom/prometheus:v3.13.1
container_name: prometheus
command:
- --config.file=/etc/prometheus/prometheus.yaml
- --storage.tsdb.path=/prometheus
- --storage.tsdb.retention.time=15d
- --web.enable-lifecycle
- --web.route-prefix=/prometheus
- --web.external-url=http://${MONITORING_HOST:-localhost:8080}/prometheus
ports:
- "9090:9090"
labels:
- logging=promtail
volumes:
- ./prometheus/prometheus.yaml:/etc/prometheus/prometheus.yaml:ro
extra_hosts: ["host.docker.internal:host-gateway"]
networks: [monitoring]
restart: unless-stopped
loki:
image: grafana/loki:3.7.3
container_name: loki
command: -config.file=/etc/loki/config.yaml -target=all
volumes:
- ./loki/loki-config.yaml:/etc/loki/config.yaml:ro
ports:
- "3100:3100"
labels:
- logging=promtail
networks: [monitoring]
restart: unless-stopped
grafana:
image: grafana/grafana:13.1.0
container_name: grafana
environment:
GF_SECURITY_ADMIN_USER: "${GRAFANA_ADMIN_USER:-admin}"
GF_SECURITY_ADMIN_PASSWORD: "${GRAFANA_ADMIN_PASSWORD:-admin}"
GF_SERVER_ROOT_URL: "http://${MONITORING_HOST:-localhost:8080}/grafana/"
GF_SERVER_SERVE_FROM_SUB_PATH: "true"
GF_ANALYTICS_CHECK_FOR_UPDATES: "false"
GF_ANALYTICS_CHECK_FOR_PLUGIN_UPDATES: "false"
GF_PLUGINS_PREINSTALL_SYNC: ""
ports:
- "3000:3000"
labels:
- logging=promtail
volumes:
- ./grafana-provisioning/datasources:/etc/grafana/provisioning/datasources:ro
- ./grafana-provisioning/dashboards:/etc/grafana/provisioning/dashboards:ro
extra_hosts: ["host.docker.internal:host-gateway"]
networks: [monitoring]
restart: unless-stopped
tempo:
image: grafana/tempo:3.0.2
container_name: tempo
command: ["-config.file=/etc/tempo/config.yaml", "-target=all"]
labels:
- logging=promtail
volumes:
- ./tempo/tempo-config.yaml:/etc/tempo/config.yaml:ro
ports:
- "3200:3200"
- "4317:4317"
- "4318:4318"
networks: [monitoring]
restart: unless-stopped
volumes:
nginx_cache: {}
promtail_positions: {}