Skip to content

The open-source app everyone uses to manage agents at work

fix(docker): run production server as non-root node user

AiMagic500057406dbc90e9
diff --git a/Dockerfile b/Dockerfile
index ee5661094e..3fe1f2b260 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -32,8 +32,10 @@ RUN test -f server/dist/index.js || (echo "ERROR: server build output missing" &
FROM base AS production
WORKDIR /app
-COPY --from=build /app /app
-RUN npm install --global --omit=dev @anthropic-ai/claude-code@latest @openai/codex@latest opencode-ai
+COPY --chown=node:node --from=build /app /app
+RUN npm install --global --omit=dev @anthropic-ai/claude-code@latest @openai/codex@latest opencode-ai \
+ && mkdir -p /paperclip \
+ && chown node:node /paperclip
ENV NODE_ENV=production \
HOME=/paperclip \
@@ -49,4 +51,5 @@ ENV NODE_ENV=production \
VOLUME ["/paperclip"]
EXPOSE 3100
+USER node
CMD ["node", "--import", "./server/node_modules/tsx/dist/loader.mjs", "server/dist/index.js"]