services: postgres: image: postgres:16-alpine container_name: sparc-postgres environment: POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres POSTGRES_DB: sparc ports: - "5432:5432" volumes: - postgres_data:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U postgres"] interval: 10s timeout: 5s retries: 5 app: build: context: . dockerfile: Dockerfile container_name: sparc-app depends_on: postgres: condition: service_healthy environment: USE_DATABASE: true DATABASE_URL: postgresql://postgres:postgres@postgres:5432/sparc ports: - "8000:8000" volumes: - .:/app volumes: postgres_data: