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
Description
The CI pipeline does not build or test the Docker image, meaning a broken
Dockerfileor misconfiguredHEALTHCHECKdirective can reach production undetected. Additionally,/health/readyand/health/livetimeouts insrc/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
docker-buildjob to.github/workflows/ci.ymlthat runsdocker build, starts the container, and pollsGET /health/liveuntil healthy or times outHEALTHCHECK--timeoutand--intervalinDockerfileviaARGbuild arguments defaulting to sensible valuesHEALTH_CHECK_TIMEOUT_MSandHEALTH_CHECK_INTERVAL_MStosrc/config/env.tsand wire them intoHealthCheckManagerSuggested execution
Fork the repo and create a branch
Implement changes
.github/workflows/ci.yml— adddocker-buildjob with smoke testDockerfile— parameterise HEALTHCHECK timeout/interval via ARGsrc/config/env.ts— add health-check timeout env varssrc/config/health.ts— read timeout from env inHealthCheckManagertests/config/health.test.tsdocs/deployment.md— document Docker health-check tuningTest and commit
pnpm test(orpnpm test:coverage)Example commit message
Guidelines