version: "3.8" services: voicescope: build: . ports: - "8000:8000" env_file: - .env environment: - DATA_DIR=/app/data - DATABASE_URL=postgresql://${POSTGRES_USER:-voicescope}:${POSTGRES_PASSWORD:?Set POSTGRES_PASSWORD in .env}@postgres:5432/${POSTGRES_DB:-voicescope} volumes: - voicescope_data:/app/data depends_on: postgres: condition: service_healthy restart: unless-stopped healthcheck: test: ["CMD", "python", "-c", "import httpx; httpx.get('http://localhost:8000/api/v1/health').raise_for_status()"] interval: 30s timeout: 10s retries: 3 postgres: image: postgres:16-alpine environment: POSTGRES_USER: ${POSTGRES_USER:-voicescope} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?Set POSTGRES_PASSWORD in .env} POSTGRES_DB: ${POSTGRES_DB:-voicescope} volumes: - pg_data:/var/lib/postgresql/data restart: unless-stopped healthcheck: test: ["CMD-SHELL", "pg_isready -U voicescope"] interval: 5s timeout: 5s retries: 5 volumes: voicescope_data: pg_data: