services: db: image: postgres:16-alpine container_name: auth-postgres restart: unless-stopped environment: POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres POSTGRES_DB: authdb ports: - "5433:5432" volumes: - db_data:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U auth_user -d auth_db"] interval: 10s timeout: 5s retries: 10 start_period: 10s api: build: context: . dockerfile: Dockerfile container_name: auth_service restart: unless-stopped ports: - "8000:8000" env_file: - .env environment: DATABASE_URL: postgresql+asyncpg://postgres:postgres@db:5432/authdb depends_on: db: condition: service_healthy volumes: - .:/app volumes: db_data: name: db_data