Deployment: hbf-lcm
Infrastructure config for this service. Full platform deployment:
docs/architecture/deployment.md
Runtime
- Port: 3000
- Base image: node:latest (multi-stage)
- Start command:
npm run start:prod - Health check: none defined
Required Environment Variables
Service Config
| Variable | Example | Description |
|---|---|---|
| SERVICE_URL | http://localhost | Public base URL of the service |
| SERVICE_PORT | 3000 | HTTP listen port |
| SERVICE_LOG_LEVEL | log,error,warn,verbose | NestJS log levels (comma-separated) |
| SERVICE_MAX_UPLOAD_SIZE_MB | 20 | Max upload file size in MB |
| SERVICE_MAX_UPLOAD_FILES_PER_REQUEST | 5 | Max files per upload request |
| SERVICE_TRANSLATION_TIMEOUT_SECONDS | 10 | Translation call timeout |
Pino Logger
| Variable | Example | Description |
|---|---|---|
| PINO_LOGGER_USE | true | Enable Pino structured logging |
| PINO_LOGGER_LEVEL | trace | Pino log level |
| PINO_LOGGER_AUTO_LOGGING | false | Auto-log all HTTP requests |
Auth / JWT
| Variable | Example | Description |
|---|---|---|
| JWT_SECRET | super-safe-secret | Secret for signing/verifying local JWTs |
| JWT_SUB | verified-before-request | Expected sub claim for local JWT validation |
External Services
| Variable | Example | Description |
|---|---|---|
| HBF_CORE_URL | http://localhost:8080 | hbf-core API base URL |
| HBF_CORE_API_TOKEN | (secret) | Auth token for hbf-core calls |
| HBF_BOT_EVENT_URL | http://localhost:8000/livechat-events | hbf-bot event webhook URL |
| HBF_BOT_EVENT_TOKEN | (secret) | Auth token for hbf-bot events |
| HBF_EVENT_PUBLISHER_URL | http://localhost:5000 | hbf-event-publisher base URL |
MS Teams
| Variable | Example | Description |
|---|---|---|
| MS_TEAMS_CLIENT_ID | Azure app client ID | |
| MS_TEAMS_CLIENT_SECRET | Azure app client secret | |
| MS_TEAMS_APPLICATION_ID | Teams application ID | |
| MS_TEAMS_TOKEN_URL | https://login.microsoftonline.com/botframework.com/oauth2/v2.0/token | OAuth token endpoint |
| MS_TEAMS_FALLBACK_URL | https://smba.trafficmanager.net/emea | Teams fallback URL |
| MS_TEAMS_DEEP_LINK | Teams deep-link base URL |
Database (MySQL)
| Variable | Example | Description |
|---|---|---|
| TYPEORM_CONNECTION | mysql | Database driver |
| TYPEORM_HOST | localhost | MySQL host |
| TYPEORM_PORT | 3306 | MySQL port |
| TYPEORM_USERNAME | root | MySQL username |
| TYPEORM_PASSWORD | MySQL password | |
| TYPEORM_DATABASE | lcm | MySQL database name |
| TYPEORM_ENTITIES | dist/**/*.entity.js | Entity file glob |
| TYPEORM_MIGRATIONS | dist/migrations/*.js | Migration file glob |
| TYPEORM_MIGRATIONS_DIR | src/migrations | Source migrations directory |
| TYPEORM_AUTORUN_MIGRATIONS | true | Run migrations on startup |
Storage (S3-compatible)
| Variable | Example | Description |
|---|---|---|
| STORAGE_ACCESS_KEY | S3 access key | |
| STORAGE_SECRET_KEY | S3 secret key | |
| STORAGE_BUCKET | S3 bucket name | |
| STORAGE_SIGNATURE_VERSION | v4 | S3 signature version |
| STORAGE_FORCE_S3_PATH_STYLE | true | Force path-style S3 URLs |
| STORAGE_REGION_S3 | us-east-1 | S3 region (S3-specific) |
| STORAGE_ENDPOINT | Override S3 endpoint (optional) |
Redis (Message Queue)
| Variable | Example | Description |
|---|---|---|
| REDIS_ENABLE | false | Enable Redis message queue |
| REDIS_URL | redis://localhost:6379 | Redis connection URL |
| REDIS_DB | 3 | Redis DB index |
Redis (Cache)
| Variable | Example | Description |
|---|---|---|
| CACHE_REDIS_ENABLE | false | Use Redis for caching (false = in-memory) |
| CACHE_REDIS_URL | redis://localhost:6379 | Redis cache connection URL |
| CACHE_REDIS_DB | 3 | Redis cache DB index |
| CACHE_TTL | 20 | Cache TTL in seconds |
Sentry
| Variable | Example | Description |
|---|---|---|
| SENTRY_DSN | Sentry DSN | |
| SENTRY_ENV | Sentry environment tag | |
| SENTRY_RELEASE | Sentry release tag | |
| SENTRY_LOG_LEVEL | error,warn | Log levels forwarded to Sentry |
Note: Sentry is NOT an active dependency. There is no
@sentrypackage inpackage.json. These env vars are only read for display in the/configendpoint, not for error tracking.
Monitor
| Variable | Example | Description |
|---|---|---|
| MONITOR_ENABLED | true | Enable conversation monitor |
| MONITOR_INTERVAL_SECONDS | 60 | Monitor poll interval |
| MONITOR_REQUEST_EXPIRATION_FALLBACK_SECONDS | 300 | Default request expiration |
| MONITOR_CONVERSATION_IDLE_EXPIRATION_SECONDS | 3600 | Idle conversation expiration |
| MONITOR_CONVERSATION_IDLE_REMINDER_TRIES | 1 | Idle reminder attempts before closing |
| MONITOR_TRANSFER_REQUEST_EXPIRATION_SECONDS | 300 | Transfer request expiration |
Elastic APM
| Variable | Example | Description |
|---|---|---|
| ELASTIC_APM_ACTIVE | false | Enable Elastic APM |
| ELASTIC_APM_SERVER_URL | APM server URL | |
| ELASTIC_APM_SECRET_TOKEN | APM auth token | |
| ELASTIC_APM_SERVICE_NAME | hbf-lcm | APM service name |
| ELASTIC_APM_ENVIRONMENT | local | APM environment tag |
Twilio
| Variable | Example | Description |
|---|---|---|
| TWILIO_ACCOUNT_SID | Twilio account SID | |
| TWILIO_AUTH_TOKEN | Twilio auth token | |
| TWILIO_API_KEY_SID | Twilio API key SID | |
| TWILIO_API_KEY_SECRET | Twilio API key secret |
Docker
# Build
docker build -t hbf-lcm .
# Run (local dev)
docker compose up
docker-compose starts MySQL 8.0.34 (database: lcm) and the service on port 3000.
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
- Live Chat Manager service.