Skip to main content

Deployment: hbf-data-manager

Infrastructure config for this service. Full platform deployment: docs/architecture/deployment.md

Runtime

  • Port: 3000 (default; overridden by PORT env var)
  • Base image (build): node:latest
  • Base image (runtime): node:latest
  • Start command: npm run start:prod
  • Health check: GET /health — returns {"status":"ok","timestamp":"<ISO>","uptimeSeconds":<N>}

Required Environment Variables

VariableExampleDescription
PORT3000HTTP listen port
NODE_ENVproductionRuntime environment
CORE_URLhttp://hbf-core:8080hbf-core base URL
CORE_TOKENsecretCore API auth token
MYSQL_HOSTmysqlMySQL hostname
MYSQL_PORT3306MySQL port
MYSQL_USERhbfMySQL username
MYSQL_PASSWORDsecretMySQL password
MYSQL_DBhbf_data_managerMySQL database name
DB_SYNCHRONIZEfalseTypeORM schema sync (disable in prod)
TYPEORM_AUTORUN_MIGRATIONStrueRun migrations on startup
KAFKA_BROKERSkafka:9092Comma-separated Kafka broker list
KAFKA_CLIENT_IDhbf-data-managerKafka client identifier
KAFKA_GROUP_IDhbf-data-managerKafka consumer group ID
KAFKA_TOPICStopic1,topic2Comma-separated topics to subscribe
PINO_LOGGER_USEtrueEnable Pino logger
PINO_LOG_LEVELinfoPino log level

Kafka Security (optional — required for SSL/SASL brokers)

VariableExampleDescription
KAFKA_SSLtrueNot used in code. SSL is derived from KAFKA_SECURITY_PROTOCOL
KAFKA_SECURITY_PROTOCOLSASL_SSLSecurity protocol
KAFKA_SASL_MECHANISMPLAINNot used in code. SASL mechanism is hardcoded as 'plain'
KAFKA_SASL_USERNAMEuserSASL username
KAFKA_SASL_PASSWORDsecretSASL password
KAFKAJS_NO_PARTITIONER_WARNING1Suppress KafkaJS partitioner warning

Docker

# Build (requires GITHUB_TOKEN for @helvia npm registry)
docker build --build-arg GITHUB_TOKEN=<token> -t hbf-data-manager .

# Run
docker run -p 3000:3000 --env-file .env hbf-data-manager

Multi-stage build: stage 1 (build) compiles TypeScript; stage 2 (runtime) copies compiled dist/ and node_modules.

docker-compose (standalone dev stack)

The bundled docker-compose.yml brings up four services:

ServiceImagePortsNotes
apphbf-data-manager (built)3000:3000Depends on db + kafka healthy
dbmysql:8.43306:3306Dev credentials from env or defaults
kafkaconfluentinc/cp-kafka:7.6.19092:9092, 29092:29092KRaft mode (no ZooKeeper), cluster ID fixed
control-centerconfluentinc/cp-enterprise-control-center:7.6.19021:9021 (configurable via CONTROL_CENTER_PORT)Confluent Control Center UI

In the platform local dev environment this service runs natively (npm run start:dev) against the shared MySQL instance, without spinning up its own Kafka.

CI/CD

  • Workflow: ci.yml
  • Trigger: push to develop, staging, main
  • Steps: SonarQube audit (parallel) + Docker build → push to AWS ECR → kubectl deploy
  • Deploy target: AWS EKS (eu-central-1)
    • develophelvia-dev namespace
    • staginghelvia-stg namespace
    • mainhelvia namespace
  • Rollout timeout: 600s
  • Build arg: GITHUB_TOKEN (from PAT_TOKEN secret) for @helvia npm scope
  • K8s config: KUBE_CONFIG_DATA_NEW secret

Notes

  • Kafka is a new infrastructure dependency not present in the platform's shared docker-compose. In the standalone docker-compose it runs in KRaft mode (no ZooKeeper). In production (EKS) it connects to an external Kafka cluster via KAFKA_BROKERS.
  • The node:latest base image is unpinned — consider pinning to a specific version for reproducible builds.
  • No explicit Docker EXPOSE directive in the Dockerfile; port is driven entirely by the PORT env var (defaults to 3000 in code).