Dockerfile: multi-stage node:22-alpine build #7
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Type
Task
Lineage
Depends on scaffolding ticket. No parent issue.
Repo
forgejo_admin/westside-adminUser Story
story-westside-admin-admin-row-crud. Foundational — the image-build pipeline requires a Dockerfile.Context
westside-admin deploys via the same kaniko→Harbor→kustomize-tag→ArgoCD pipeline as westside-app. This ticket creates the Dockerfile that kaniko will build. Multi-stage to keep the runtime image small. Reference
~/westside-app/Dockerfilefor the proven pattern (if it exists; otherwise mirror the SvelteKit adapter-node official guide).Scope
Create
Dockerfilewith two stages: abuilderstage that runsnpm ciandnpm run build, and aruntimestage that copies only thebuild/directory +node_modules(production only) and runsnode build/index.js. Create.dockerignoreexcluding node_modules, .git, .env, README.md, .vscode, .playwright-mcp, screenshots, and any other dev artifacts. Usenode:22-alpinefor both stages. Run as non-root user (UID 1000+). EXPOSE 3000. Define a HEALTHCHECK that hitsGET /healthand expects 200.Verify locally:
docker build -t westside-admin:test .succeeds,docker run -p 3000:3000 westside-admin:testserves on port 3000, image size under 250MB, no secrets baked into layers (verify viadocker history).Acceptance Criteria
docker build -t westside-admin:test .succeeds locallydocker history)Test Expectations
docker buildthendocker run -p 3000:3000 westside-admin:testthencurl http://localhost:3000/healthreturns 200trivy image westside-admin:testshows zero HIGH/CRITICAL vulns in base layerConstraints
node:22-alpineto match westside-app's Node versionChecklist
Related
project-westside-adminarch-deployment-westside-adminScope Review: READY
Review note:
review-1088-2026-04-25Scope is solid, traceability complete (story + arch notes verified), AC testable, fits a single agent pass. Hard dep on scaffolding #6 (also in backlog) — both can review in parallel, dev work serializes.
Three nice-to-haves for the dev agent (not blockers):
[BODY]Add AC bullet for non-root UID verification (constraint→AC gap)[BODY]Reference Dockerfile note:~/westside-app/Dockerfileis adapter-static + nginx, not adapter-node — steer to SvelteKit adapter-node pattern (or westside-contracts) instead[SCOPE]Coordinate/healthroute with scaffolding #6, or HEALTHCHECK AC fails in isolationPR opened: #10
Local validation:
docker buildsucceededcurl localhost:3000/health-> HTTP 200nodeuser (UID 1000)