name: gradientfox

services:
  postgres:
    image: postgres:16-alpine
    hostname: foxdb
    volumes:
      - pgdata:/var/lib/postgresql/data
    environment:
      - POSTGRES_PASSWORD=password
      - POSTGRES_USER=postgres
      - POSTGRES_DB=postgres
  metrics:
    image: gradientfox/metrics:1.0.4
    hostname: foxmetrics
    user: root
    volumes:
      - metrics_data:/data
    environment:
      - GF_SCRAPE_SCHEME=http
      - GF_SCRAPE_URL=foxserver:8098
  webserver:
    image: gradientfox/webui:1.0.4
    hostname: foxserver
    ports:
      - 8098:8098
    environment:
      - GF_DB_USERNAME=postgres
      - GF_DB_PASSWORD=password
      - GF_DB_URL=jdbc:postgresql://foxdb:5432/postgres
      - GF_SERVER_PORT=8098
      - GF_METRICS_QUERY_API_URL=http://foxmetrics:9009
    depends_on:
      - postgres
      - metrics

volumes:
  pgdata:
  metrics_data:
