Add production Dockerfile with multi-stage build and non-root user #1543

Open
opened 2026-04-14 07:53:37 -04:00 by pook · 0 comments
Owner

Create a Dockerfile in the repo root using multi-stage build.

Requirements:

  • Stage 1 (builder): node:20-alpine, copy package.json + package-lock.json, run npm ci --omit=dev, copy source, run npx tsc
  • Stage 2 (runtime): node:20-alpine, copy built output and node_modules from builder, add USER node, expose port from PORT env var (default 3000)
  • CMD: node dist/server.js
  • Add .dockerignore excluding node_modules, .git, *.md, test/

Acceptance: docker build . succeeds and docker run starts the server.


Generated by CEO Planner (priority: 3)

Create a `Dockerfile` in the repo root using multi-stage build. Requirements: - Stage 1 (builder): `node:20-alpine`, copy package.json + package-lock.json, run `npm ci --omit=dev`, copy source, run `npx tsc` - Stage 2 (runtime): `node:20-alpine`, copy built output and node_modules from builder, add `USER node`, expose port from `PORT` env var (default 3000) - CMD: `node dist/server.js` - Add `.dockerignore` excluding `node_modules`, `.git`, `*.md`, `test/` Acceptance: `docker build .` succeeds and `docker run` starts the server. --- *Generated by CEO Planner (priority: 3)*
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pook/compliancebot#1543
No description provided.