version: "3.8" services: db: image: postgres:18-alpine environment: POSTGRES_USER: $SERVICE_USER_POSTGRES POSTGRES_PASSWORD: $SERVICE_PASSWORD_POSTGRES POSTGRES_DB: endorphin_db volumes: - postgres_data:/var/lib/postgresql/data app: build: . environment: DATABASE_URL: postgres://$SERVICE_USER_POSTGRES:$SERVICE_PASSWORD_POSTGRES@postgres:5432/endorphin_db healthcheck: test: ["CMD", "curl", "-f", "http://localhost:8000/health"] interval: 10s timeout: 3s retries: 3 depends_on: postgres: condition: service_healthy volumes: postgres_data: