fix(docker): use existing nobody user instead of creating UID 65534

This commit is contained in:
2026-02-22 09:54:35 +01:00
parent 2f9f4c4b49
commit e957419b77

View File

@@ -25,16 +25,14 @@ RUN bun run build
# ─────────────────────────────────────────────
FROM node:22-alpine
# UID 65534 = nobody on Alpine, matches podSecurityContext.runAsUser
RUN adduser -D -u 65534 -g '' nonroot
WORKDIR /app
COPY --from=builder /app/build ./build
COPY --from=deps /app/node_modules ./node_modules
COPY --from=builder /app/package.json .
USER nonroot:nonroot
# node:22-alpine already ships nobody at UID 65534 — matches podSecurityContext.runAsUser
USER nobody:nobody
# ORIGIN is required by adapter-node for CSRF protection.
# Must match the public-facing URL exactly (set via k8s ConfigMap).