services:
  e2e-br-mock-server:
    build:
      context: .
      dockerfile: Dockerfile.mock-server
    volumes:
      - backup-storage:/backup-storage
    container_name: e2e-br-mock-server
    healthcheck:
      test: ["CMD", "wget", "-q", "--spider", "http://localhost:4050/health"]
      interval: 2s
      timeout: 5s
      retries: 10

  e2e-br-runner:
    build:
      context: .
      dockerfile: Dockerfile.backup-restore-runner
      args:
        PG_VERSION: ${PG_VERSION:-17}
    volumes:
      - ./artifacts:/opt/agent/artifacts:ro
      - ./scripts:/opt/agent/scripts:ro
    depends_on:
      e2e-br-mock-server:
        condition: service_healthy
    container_name: e2e-br-runner
    command: ["bash", "/opt/agent/scripts/test-pg-host-path.sh"]
    environment:
      MOCK_SERVER_OVERRIDE: "http://e2e-br-mock-server:4050"

volumes:
  backup-storage:
