services:
  postgres:
    image: postgres:17
    container_name: postgres
    environment:
      POSTGRES_DB: validation_suite
      POSTGRES_USER: validation
      POSTGRES_PASSWORD: validation123
    volumes:
      - validation_suite_postgres:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U validation -d validation_suite"]
      interval: 5s
      timeout: 5s
      retries: 20

  mercury-api:
    build:
      context: ./backend/mercury
    container_name: mercury-api
    depends_on:
      postgres:
        condition: service_healthy
    environment:
      DATABASE_URL: postgresql+psycopg://validation:validation123@postgres:5432/validation_suite
      JWT_SECRET: validation-suite-local-jwt-secret
      PUBLIC_BASE_URL: http://localhost:8000
      ADMIN_EMAIL: admin@schubamed.de
      ADMIN_PASSWORD: ValidationSuite!2026
    ports:
      - "8000:8000"
    volumes:
      - mercury_uploads:/app/uploads
      - mercury_reports:/app/reports

  atlas-web:
    build:
      context: ./frontend/atlas
    container_name: atlas-web
    depends_on:
      - mercury-api
    environment:
      NEXT_PUBLIC_API_BASE_URL: http://localhost:8000/api/v1
    ports:
      - "3000:3000"

volumes:
  validation_suite_postgres:
  mercury_uploads:
  mercury_reports:
