services: test-db: image: postgres:16-alpine ports: - "5433:5432" environment: - POSTGRES_USER=postgres - POSTGRES_PASSWORD=postgres - POSTGRES_DB=nuzlocke_test tmpfs: - /var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U postgres"] interval: 2s timeout: 5s retries: 10 restart: "no" test-api: build: context: ./backend dockerfile: Dockerfile ports: - "8000:8000" environment: - DATABASE_URL=postgresql+asyncpg://postgres:postgres@test-db:5432/nuzlocke_test - DEBUG=true depends_on: test-db: condition: service_healthy healthcheck: test: ["CMD-SHELL", "curl -f http://localhost:8000/ || exit 1"] interval: 3s timeout: 5s retries: 15 restart: "no"