Deployment: hbf-stats
Infrastructure config for this service. Full platform deployment:
docs/architecture/deployment.md
Runtime
- Port: configurable via SERVICE_PORT (no default exposed in docker-compose)
- Base image: node:18 / node:18-slim (multi-stage)
- Start command:
npm run start - Health check: none defined
Required Environment Variables
| Variable | Example | Description |
|---|---|---|
| CORE_URL | http://hbf-core:8080 | hbf-core API base URL |
| CORE_TOKEN | token | Auth token for hbf-core |
| STATS_LIFESPAN_MINUTES | 60 | Stats aggregation window |
| EXECUTION_TIME_INTERVAL_MILLISECONDS | 30000 | Main loop interval |
| BATCH_SIZE | 100 | Tenants per batch |
| BATCH_COOLDOWN_SECONDS | 5 | Pause between batches |
| PINO_LOGGER_USE | true | Enable Pino logger |
| PINO_LOGGER_LEVEL | info | Pino log level |
| PINO_LOGGER_AUTO_LOGGING | true | Auto-log HTTP requests |
| SERVICE_PORT | 3000 | HTTP listening port (optional) |
| NUMBER_OF_TENANTS_TO_BE_UPDATED | 10 | Max tenants updated per cycle |
Docker
# Build
docker build -t hbf-stats .
# Run (local dev)
docker compose up
docker-compose defines the service only (no ports mapped, no database container).
CI/CD
- Trigger: push to main/staging/develop
- Steps: SonarQube audit -> Docker build -> Push to ECR -> Deploy to EKS
- Deploy target: AWS EKS (helvia-dev, helvia-stg, helvia)
Notes
- Daemon process with an infinite loop. No HTTP endpoints exposed by default.
- Aggregates stats by calling hbf-core API in configurable batches.
- SERVICE_PORT is optional and only relevant if HTTP health checks are needed in K8s.