version: "3.4"

# Local monitoring setup with Prometheus and Grafana
# See docs/pages/run/logging-and-metrics/prometheus-grafana.md for detailed usage instructions

services:
  prometheus:
    build:
      context: prometheus
    environment:
      BEACON_URL: host.docker.internal:8008
      VC_URL: host.docker.internal:5064
    restart: always
    volumes:
      - "prometheus:/prometheus"
    extra_hosts:
      - "host.docker.internal:host-gateway"
    ports:
      - "127.0.0.1:9090:9090"

  grafana:
    build:
      context: ..
      dockerfile: docker/grafana
    restart: always
    volumes:
      - "grafana:/var/lib/grafana"
      - "grafana-dashboards:/dashboards"
    environment:
      PROMETHEUS_URL: http://host.docker.internal:9090
    extra_hosts:
      - "host.docker.internal:host-gateway"
    ports:
      - "127.0.0.1:3000:3000"

volumes:
  prometheus:
  grafana:
  grafana-dashboards:
