services: db: image: postgres:16-alpine environment: POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres POSTGRES_DB: kcapp volumes: - pgdata:/var/lib/postgresql/data ports: - "5432:5432" healthcheck: test: ["CMD-SHELL", "pg_isready -U postgres -d kcapp"] interval: 5s timeout: 5s retries: 10 api: build: context: . dockerfile: Dockerfile depends_on: db: condition: service_healthy # All non-DB config comes from .env (needs Docker Compose v2, which # strips surrounding quotes). DATABASE_URL and the FCM credential path # are overridden below for the container. env_file: - .env environment: DATABASE_URL: postgresql://postgres:***@db:5432/kcapp?schema=public PORT: "3000" GOOGLE_APPLICATION_CREDENTIALS: /app/serviceAccount.json APP_BASE_URL: http://localhost:3010 WEB_CLIENT_DIR: /app/web ports: - "3010:3000" volumes: # Firebase service account — kept out of the image, mounted read-only. - ./serviceAccount.json:/app/serviceAccount.json:ro # Pre-built Flutter web bundle, built separately in the KC-APP client # repo (flutter build web --release) and mounted read-only here. # Set WEB_CLIENT_BUILD_PATH (e.g. in .env) to that build/web directory; # defaults to a sibling ../KC-APP checkout. - ${WEB_CLIENT_BUILD_PATH:-../KC-APP/client/app/build/web}:/app/web:ro volumes: pgdata: