-
Notifications
You must be signed in to change notification settings - Fork 341
/
metrics-docker-compose.yaml
55 lines (50 loc) · 1.63 KB
/
metrics-docker-compose.yaml
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
version: "3"
networks:
aligned-network:
name: aligned-network
driver: bridge
services:
grafana:
image: grafana/grafana:10.1.10
container_name: grafana
volumes:
- grafana_data:/var/lib/grafana
- ./grafana/provisioning:/etc/grafana/provisioning
environment:
# See https://grafana.com/docs/grafana/latest/setup-grafana/configure-grafana/#override-configuration-with-environment-variables
# and https://grafana.com/docs/grafana/latest/setup-grafana/configure-docker/
# They recommend using env vars instead of overwriting config.ini
- GF_SECURITY_ADMIN_USER=${ADMIN_USER:-admin}
- GF_SECURITY_ADMIN_PASSWORD=${ADMIN_PASSWORD:-admin}
- GF_USERS_ALLOW_SIGN_UP=false
restart: unless-stopped
ports:
- "3000:3000"
networks:
- aligned-network
prometheus:
image: prom/prometheus:v2.52.0
container_name: prometheus
volumes:
- ./prometheus:/etc/prometheus
- prometheus_data:/prometheus
command:
- "--config.file=/etc/prometheus/prometheus.yaml"
- "--storage.tsdb.path=/prometheus"
- "--web.console.libraries=/etc/prometheus/console_libraries"
- "--web.console.templates=/etc/prometheus/consoles"
- "--storage.tsdb.retention.time=200h"
- "--web.enable-lifecycle"
- --web.enable-remote-write-receiver
restart: unless-stopped
expose:
- 9090
networks:
- aligned-network
# host.docker.internal might not work on linux
# https://stackoverflow.com/a/67158212/4971151
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
prometheus_data: {}
grafana_data: {}