---
volumes:
  akvorado-grafana:
services:
  grafana:
    extends:
      file: versions.yml
      service: grafana
    profiles: [ grafana ]
    environment:
      GF_SERVER_ROOT_URL: /grafana
      GF_SERVER_SERVE_FROM_SUB_PATH: "true"
    depends_on:
      - prometheus
    restart: unless-stopped
    volumes:
      - akvorado-grafana:/var/lib/grafana
      - ./grafana:/etc/grafana
    expose:
      - 3000/tcp
    labels:
      - traefik.enable=true
      - traefik.http.routers.grafana.rule=PathPrefix(`/grafana`)
      - traefik.http.routers.grafana.middlewares=console-auth,grafana-avatar
      - traefik.http.middlewares.grafana-avatar.redirectRegex.regex=^(https?://.+)/grafana/avatar/.+
      - traefik.http.middlewares.grafana-avatar.redirectRegex.replacement=$${1}/api/v0/console/user/avatar
      - metrics.port=3000
