Skip to content

Add Docker build verification and health-check timeout tuning to CI #244

@Jagadeeshftw

Description

@Jagadeeshftw

Description

The CI pipeline does not build or test the Docker image, meaning a broken Dockerfile or misconfigured HEALTHCHECK directive can reach production undetected. Additionally, /health/ready and /health/live timeouts in src/config/health.ts (HealthCheckManager) are hardcoded rather than configurable. A Docker build-and-smoke-test CI step and environment-driven health-check timeouts must be added.

Requirements and context

  • Add a docker-build job to .github/workflows/ci.yml that runs docker build, starts the container, and polls GET /health/live until healthy or times out
  • Parameterise the HEALTHCHECK --timeout and --interval in Dockerfile via ARG build arguments defaulting to sensible values
  • Add HEALTH_CHECK_TIMEOUT_MS and HEALTH_CHECK_INTERVAL_MS to src/config/env.ts and wire them into HealthCheckManager
  • Must be secure, tested, and documented
  • Should be efficient and easy to review

Suggested execution

Fork the repo and create a branch

git checkout -b feature/ci-docker-build-healthcheck

Implement changes

  • Update/Write: .github/workflows/ci.yml — add docker-build job with smoke test
  • Update/Write: Dockerfile — parameterise HEALTHCHECK timeout/interval via ARG
  • Update/Write: src/config/env.ts — add health-check timeout env vars
  • Update/Write: src/config/health.ts — read timeout from env in HealthCheckManager
  • Write comprehensive tests: tests/config/health.test.ts
  • Add documentation: docs/deployment.md — document Docker health-check tuning
  • Include clear code comments and types
  • Validate security assumptions

Test and commit

  • Run tests: pnpm test (or pnpm test:coverage)
  • Cover edge cases: container starts healthy, container starts unhealthy (smoke test fails CI), custom timeout env var respected, zero timeout rejected
  • Include test output and security notes

Example commit message

ci: add Docker build verification and configurable health-check timeouts

Guidelines

  • Minimum 95 percent test coverage
  • Clear documentation
  • Timeframe: 96 hours

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stellar WaveIssues in the Stellar wave programbackendBackend service workdevopsCI / Docker / deployobservabilityLogging / metrics / tracing

    Type

    No fields configured for Task.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions