services: db: image: docker.io/library/postgres:16-alpine restart: unless-stopped environment: POSTGRES_DB: kmountain POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres volumes: - pgdata:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U postgres"] interval: 5s timeout: 5s retries: 5 api: build: context: ./backend dockerfile: Dockerfile restart: unless-stopped environment: KMTN_DATABASE_URL: postgresql+asyncpg://postgres:postgres@db:5432/kmountain KMTN_CORS_ORIGINS: '["http://localhost:4200"]' ports: - "8000:8000" depends_on: db: condition: service_healthy frontend: build: context: . dockerfile: Dockerfile restart: unless-stopped ports: - "4200:80" depends_on: - api volumes: pgdata: