1
0
Fork 0
myserver-configuration/roles/metrics/templates/docker-compose.yml

65 lines
2.3 KiB
YAML

version: '3'
services:
prometheus:
image: prom/prometheus:latest
restart: unless-stopped
container_name: prometheus
volumes:
- {{ server.work_dir }}/prometheus/config:/etc/prometheus
- {{ server.work_dir }}/prometheus/base:/prometheus
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
command:
- "--web.route-prefix=/"
- "--web.external-url=https://prometheus.{{ server.domain }}/"
- "--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"
networks:
- metrics
- proxy
labels:
- traefik.enable=true
- traefik.http.routers.prometheus-secure.entrypoints=https
- traefik.http.routers.prometheus-secure.rule=Host(`prometheus.{{ server.domain }}`)
- traefik.http.routers.prometheus-secure.middlewares=private-network@file
- traefik.http.routers.prometheus-secure.tls=true
- traefik.http.routers.prometheus-secure.tls.certresolver=sslResolver
- traefik.http.routers.prometheus-secure.service=prometheus
- traefik.http.services.prometheus.loadbalancer.server.port=9090
- traefik.docker.network=proxy
grafana:
image: grafana/grafana:latest
restart: unless-stopped
container_name: grafana
volumes:
- {{ server.work_dir }}/grafana/base:/var/lib/grafana
- {{ server.work_dir }}/grafana/provisioning:/etc/grafana/provisioning
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
env_file:
- grafana.env
depends_on:
- prometheus
networks:
- proxy
- metrics
labels:
- traefik.enable=true
- traefik.http.routers.grafana-secure.entrypoints=https
- traefik.http.routers.grafana-secure.rule=Host(`grafana.{{ server.domain }}`)
- traefik.http.routers.grafana-secure.middlewares=private-network@file
- traefik.http.routers.grafana-secure.tls=true
- traefik.http.routers.grafana-secure.tls.certresolver=sslResolver
- traefik.http.routers.grafana-secure.service=grafana
- traefik.http.services.grafana.loadbalancer.server.port=3000
- traefik.docker.network=proxy
networks:
metrics:
external: true
proxy:
external: true