services:
  metabase:
    image: metabase/metabase:latest
    container_name: nexus-metabase
    network_mode: host
    environment:
      - MB_DB_TYPE=postgres
      - MB_DB_DBNAME=metabase
      - MB_DB_PORT=5432
      - MB_DB_USER=metabase
      - MB_DB_PASS=${METABASE_DB_PASS:-metabase_secret}
      - MB_DB_HOST=localhost
      - JAVA_OPTS=-Xmx2g
    volumes:
      - metabase_data:/metabase-data
    restart: unless-stopped
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:3000/api/health"]
      interval: 15s
      timeout: 5s
      retries: 5

volumes:
  metabase_data:
