Production hardening — Husky pre-push, GitHub Actions CI, Dockerfile - #13
Merged
Conversation
…erfile Gate and package the finished service (closes #6): - Husky pre-push hook runs `npm run verify` (typecheck → lint → test, fail-fast); `git push --no-verify` documented as the escape hatch. - GitHub Actions CI mirrors the gate (Node 20, npm ci, typecheck, lint, test) on push/PR, then a docker-build job (no registry push). - Multi-stage Dockerfile: builder compiles; slim runtime runs dev-dependency-free as the non-root `node` user, with the catalogue seed copied in. HEALTHCHECK probes GET /health via Node's global fetch. - .dockerignore excludes node_modules, dist, .git, tests, coverage. - README with CI badge documenting endpoints, scripts, gate, and Docker. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- CI runs `npm run verify` instead of re-listing typecheck/lint/test, so the
hook and CI share one gate definition and can't drift.
- Dockerfile sets `ENV PORT=3000` and `EXPOSE ${PORT}`, giving the port a
single source shared by the app, EXPOSE, and the healthcheck.
- Document why CI's `push` trigger is main-only (feature branches run via PR;
avoids double CI runs).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #6.
Production-readiness scaffolding that gates and packages the finished service.
What's here
npm run verify(typecheck → lint → test, fail-fast). Escape hatchgit push --no-verifydocumented in the hook and README..github/workflows/ci.yml) mirrors the gate on push/PR — Node 20,npm ci, typecheck, lint, test — then adocker buildjob (push: false, gated onneeds: verify).nodeuser, with thedata/catalogue seed copied in (the app reads it from cwd at startup).HEALTHCHECKprobesGET /healthvia Node's globalfetch(no curl/wget in the image)..dockerignoreexcludesnode_modules,dist,.git, tests, coverage — keepsdata/.Acceptance criteria — all met
--no-verifydocumentednode.dockerignoreexcludes node_modules, dist, .git, tests, coverageHEALTHCHECKtargetsGET /healthVerification
node, serves/healthand/hotels, and Docker health status reachedhealthy(probe exit 0).npm run verifygreen: 54 tests pass, typecheck + lint clean.🤖 Generated with Claude Code