Skip to content

feat: Add Multi-Stage Server Image With Non-Root Healthcheck - #18

Open
ThomasHartDev wants to merge 1 commit into
mainfrom
thomas/feat/docker-server
Open

feat: Add Multi-Stage Server Image With Non-Root Healthcheck#18
ThomasHartDev wants to merge 1 commit into
mainfrom
thomas/feat/docker-server

Conversation

@ThomasHartDev

Copy link
Copy Markdown
Owner

The server had a health endpoint and no image. This adds apps/server/Dockerfile as four stages: lockfile install, compile plus pnpm deploy --prod, then a slim runtime that drops to uid 999 and probes GET /healthz on 127.0.0.1. The repo-root .dockerignore keeps git, node_modules, and env files out of the daemon context.

image-policy.ts parses the recipe so CI can fail if the final stage is root, has HEALTHCHECK NONE, uses ADD, or bakes a secret into ENV/ARG. Built the image locally, ran as agent (uid 999), and got {"status":"ok"} from /healthz.

Closes #17

Ship apps/server as a four-stage image: lockfile install, compile,
pnpm deploy --prod, then a slim runtime as uid 999. HEALTHCHECK hits
/healthz on loopback. A small parser fails tests if the recipe is
single-stage, root, or HEALTHCHECK NONE.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a production Dockerfile for the agent server

1 participant