services: db: image: postgres:16-alpine restart: unless-stopped environment: POSTGRES_USER: notes POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-change-me} POSTGRES_DB: notes volumes: - postgres_data:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U notes"] interval: 5s timeout: 5s retries: 5 backend: build: context: ./backend dockerfile: Dockerfile restart: unless-stopped env_file: .env environment: DATABASE_URL: postgresql+asyncpg://notes:${POSTGRES_PASSWORD:-change-me}@db:5432/notes ports: - "8000:8000" volumes: - uploads:/uploads depends_on: db: condition: service_healthy volumes: postgres_data: uploads: