-
Notifications
You must be signed in to change notification settings - Fork 0
/
prometheus-grafana-docker-compose.yaml
47 lines (47 loc) · 1.77 KB
/
prometheus-grafana-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
version: '3.7'
services:
prometheus:
image: prom/prometheus
restart: unless-stopped
volumes:
- ./prometheus/:/etc/prometheus/
- prometheus_data:/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.console.libraries=/usr/share/prometheus/console_libraries'
- '--web.console.templates=/usr/share/prometheus/consoles'
labels:
- traefik.enable=true
- "traefik.http.routers.prometheus.rule=Host(`prometheus.${CF_DOMAIN}`)"
- "traefik.http.routers.prometheus.service=prometheus"
- "traefik.http.routers.prometheus.entrypoints=web-secure"
- "traefik.http.routers.prometheus.tls=true"
- "traefik.http.routers.prometheus.tls.certresolver=le"
- "traefik.http.services.prometheus.loadbalancer.server.port=9090"
grafana:
image: grafana/grafana
restart: unless-stopped
depends_on:
- prometheus
volumes:
- ./grafana/provisioning/:/etc/grafana/provisioning/
# - ./grafana/grafana.ini:/etc/grafana/grafana.ini
- grafana_data:/var/lib/grafana
environment:
GF_SECURITY_ADMIN_PASSWORD: ${GF_SECURITY_ADMIN_PASSWORD}
GF_USERS_ALLOW_SIGN_UP: ${GF_USERS_ALLOW_SIGN_UP}
GF_INSTALL_PLUGINS: ${GF_INSTALL_PLUGINS}
labels:
- traefik.enable=true
- "traefik.http.routers.grafana.rule=Host(`grafana.${CF_DOMAIN}`)"
- "traefik.http.routers.grafana.service=grafana"
- "traefik.http.routers.grafana.entrypoints=web-secure"
- "traefik.http.routers.grafana.tls=true"
- "traefik.http.routers.grafana.tls.certresolver=le"
- "traefik.http.services.grafana.loadbalancer.server.port=3000"
volumes:
prometheus_data:
name: prometheus_data
grafana_data:
name: grafana_data