Skip to main content

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

VariableExampleDescription
SERVICE_URLhttp://localhostPublic base URL of the service
SERVICE_PORT3000HTTP listen port
SERVICE_LOG_LEVELlog,error,warn,verboseNestJS log levels (comma-separated)
SERVICE_MAX_UPLOAD_SIZE_MB20Max upload file size in MB
SERVICE_MAX_UPLOAD_FILES_PER_REQUEST5Max files per upload request
SERVICE_TRANSLATION_TIMEOUT_SECONDS10Translation call timeout

Pino Logger

VariableExampleDescription
PINO_LOGGER_USEtrueEnable Pino structured logging
PINO_LOGGER_LEVELtracePino log level
PINO_LOGGER_AUTO_LOGGINGfalseAuto-log all HTTP requests

Auth / JWT

VariableExampleDescription
JWT_SECRETsuper-safe-secretSecret for signing/verifying local JWTs
JWT_SUBverified-before-requestExpected sub claim for local JWT validation

External Services

VariableExampleDescription
HBF_CORE_URLhttp://localhost:8080hbf-core API base URL
HBF_CORE_API_TOKEN(secret)Auth token for hbf-core calls
HBF_BOT_EVENT_URLhttp://localhost:8000/livechat-eventshbf-bot event webhook URL
HBF_BOT_EVENT_TOKEN(secret)Auth token for hbf-bot events
HBF_EVENT_PUBLISHER_URLhttp://localhost:5000hbf-event-publisher base URL

MS Teams

VariableExampleDescription
MS_TEAMS_CLIENT_IDAzure app client ID
MS_TEAMS_CLIENT_SECRETAzure app client secret
MS_TEAMS_APPLICATION_IDTeams application ID
MS_TEAMS_TOKEN_URLhttps://login.microsoftonline.com/botframework.com/oauth2/v2.0/tokenOAuth token endpoint
MS_TEAMS_FALLBACK_URLhttps://smba.trafficmanager.net/emeaTeams fallback URL
MS_TEAMS_DEEP_LINKTeams deep-link base URL

Database (MySQL)

VariableExampleDescription
TYPEORM_CONNECTIONmysqlDatabase driver
TYPEORM_HOSTlocalhostMySQL host
TYPEORM_PORT3306MySQL port
TYPEORM_USERNAMErootMySQL username
TYPEORM_PASSWORDMySQL password
TYPEORM_DATABASElcmMySQL database name
TYPEORM_ENTITIESdist/**/*.entity.jsEntity file glob
TYPEORM_MIGRATIONSdist/migrations/*.jsMigration file glob
TYPEORM_MIGRATIONS_DIRsrc/migrationsSource migrations directory
TYPEORM_AUTORUN_MIGRATIONStrueRun migrations on startup

Storage (S3-compatible)

VariableExampleDescription
STORAGE_ACCESS_KEYS3 access key
STORAGE_SECRET_KEYS3 secret key
STORAGE_BUCKETS3 bucket name
STORAGE_SIGNATURE_VERSIONv4S3 signature version
STORAGE_FORCE_S3_PATH_STYLEtrueForce path-style S3 URLs
STORAGE_REGION_S3us-east-1S3 region (S3-specific)
STORAGE_ENDPOINTOverride S3 endpoint (optional)

Redis (Message Queue)

VariableExampleDescription
REDIS_ENABLEfalseEnable Redis message queue
REDIS_URLredis://localhost:6379Redis connection URL
REDIS_DB3Redis DB index

Redis (Cache)

VariableExampleDescription
CACHE_REDIS_ENABLEfalseUse Redis for caching (false = in-memory)
CACHE_REDIS_URLredis://localhost:6379Redis cache connection URL
CACHE_REDIS_DB3Redis cache DB index
CACHE_TTL20Cache TTL in seconds

Sentry

VariableExampleDescription
SENTRY_DSNSentry DSN
SENTRY_ENVSentry environment tag
SENTRY_RELEASESentry release tag
SENTRY_LOG_LEVELerror,warnLog levels forwarded to Sentry

Note: Sentry is NOT an active dependency. There is no @sentry package in package.json. These env vars are only read for display in the /config endpoint, not for error tracking.

Monitor

VariableExampleDescription
MONITOR_ENABLEDtrueEnable conversation monitor
MONITOR_INTERVAL_SECONDS60Monitor poll interval
MONITOR_REQUEST_EXPIRATION_FALLBACK_SECONDS300Default request expiration
MONITOR_CONVERSATION_IDLE_EXPIRATION_SECONDS3600Idle conversation expiration
MONITOR_CONVERSATION_IDLE_REMINDER_TRIES1Idle reminder attempts before closing
MONITOR_TRANSFER_REQUEST_EXPIRATION_SECONDS300Transfer request expiration

Elastic APM

VariableExampleDescription
ELASTIC_APM_ACTIVEfalseEnable Elastic APM
ELASTIC_APM_SERVER_URLAPM server URL
ELASTIC_APM_SECRET_TOKENAPM auth token
ELASTIC_APM_SERVICE_NAMEhbf-lcmAPM service name
ELASTIC_APM_ENVIRONMENTlocalAPM environment tag

Twilio

VariableExampleDescription
TWILIO_ACCOUNT_SIDTwilio account SID
TWILIO_AUTH_TOKENTwilio auth token
TWILIO_API_KEY_SIDTwilio API key SID
TWILIO_API_KEY_SECRETTwilio 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.