feat: multi-stage Docker build + e2e test suite#2
Merged
Conversation
Eliminates the local Node.js requirement for Docker image builds. TypeScript now compiles inside the builder stage, and the runtime stage copies only the compiled output. Also removes the build-ts dependency from Makefile docker targets and the npm-run-build step from picoclaw.sh. - Add .dockerignore for faster build context transfer - Use --ignore-scripts in runtime npm ci to avoid husky errors - Update docs (CLAUDE.md, deployment guide, changelog) for consistency Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
--ignore-scripts skips all lifecycle scripts including better-sqlite3's postinstall which compiles the native .node binding. Add an explicit npm rebuild step so the addon is compiled for the target platform. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Automated test script (scripts/e2e-test.sh) covering 26 test cases: - Health check and auth rejection - 4-round multi-turn conversation with context recall - Conversation isolation between users - Task CRUD (create, list, update, check, delete) - Skills sync and persona verification - Container restart persistence with session resume - Graceful shutdown and clean exit Usage: make test-e2e (full) or make test-e2e-quick (no build/API) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Summary
npm rebuild better-sqlite3after--ignore-scriptsinstall to compile the.nodebinding for the target platformscripts/e2e-test.sh— 26 automated test cases covering the full Docker workflow.dockerignorefor faster context, Makefile/picoclaw.sh updated to remove local build dependenciesChanges
Dockerfile (multi-stage build)
builder):npm ci+npm run build— compiles TypeScriptruntime):npm ci --omit=dev --ignore-scripts+npm rebuild better-sqlite3— production deps with native addonCOPY --from=builder /build/dist/ ./dist/— only compiled output enters runtime imageBuild tooling
Makefile:docker-buildanddocker-build-lambdano longer depend onbuild-tspicoclaw.sh:build_image()removednpm run buildstep.dockerignore: excludesnode_modules,dist,dev-data, docs,.gitE2e test suite (
scripts/e2e-test.sh)26 test cases in 9 sections:
GET /healthreturnsstatus=okPOST /control/stop→ container exits cleanlyUsage:
Documentation
CLAUDE.md: Docker workflow section updatedCHANGELOG.md: unreleased changes documenteddocs/SERVERLESS_API_DEPLOYMENT_GUIDE.md: multi-stage build docs, troubleshooting updatedTest results
Test plan
npm run build— TypeScript compiles cleanlynpm test— 16 unit tests passnpm run format:check— Prettier formatting verifieddocker build --platform linux/amd64— image builds successfully./scripts/e2e-test.sh— 26/26 e2e tests pass in Docker container🤖 Generated with Claude Code