# Variante Postgres (schema.prisma doit avoir provider = "postgresql")
services:
  app:
    build: .
    ports:
      - "3000:3000"
    environment:
      - DATABASE_URL=postgresql://evaluator:secret@db:5432/evaluator
    depends_on:
      db:
        condition: service_healthy
    restart: unless-stopped

  db:
    image: postgres:16-alpine
    environment:
      POSTGRES_USER: evaluator
      POSTGRES_PASSWORD: secret
      POSTGRES_DB: evaluator
    volumes:
      - pg-data:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U evaluator"]
      interval: 5s
      timeout: 5s
      retries: 5

volumes:
  pg-data:
