services:
  db:
    image: postgres:17
    environment:
      POSTGRES_DB: validation
      POSTGRES_USER: validation
      POSTGRES_PASSWORD: validation123
    volumes:
      - validation_v2_db:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL","pg_isready -U validation -d validation"]
      interval: 5s
      timeout: 5s
      retries: 20
  web:
    build: .
    depends_on:
      db:
        condition: service_healthy
    environment:
      DATABASE_URL: postgresql+psycopg://validation:validation123@db:5432/validation
      SECRET_KEY: validation-v2-local
    ports:
      - "5003:5000"
    volumes:
      - ./app/generated:/app/generated
      - ./app/uploads:/app/uploads
volumes:
  validation_v2_db:
