version: "3.9" services: db: image: postgres:16-alpine environment: POSTGRES_USER: pole POSTGRES_PASSWORD: pole POSTGRES_DB: poledance ports: - "5432:5432" volumes: - pgdata:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U pole -d poledance"] interval: 5s timeout: 5s retries: 10 api: build: ./backend ports: - "8000:8000" environment: DATABASE_URL: postgresql+asyncpg://pole:pole@db:5432/poledance env_file: - .env depends_on: db: condition: service_healthy volumes: - ./backend:/app command: uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload volumes: pgdata: