-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
I usually deploy Node.js docker container with user node to avoid deploying with root user. It seems like node-caged does not have node user and default user is root which is not safe in production deployment.
# # ###### final image ######
FROM node:24-slim
........
WORKDIR /app
COPY --chown=node --from=builder /app/ /app/
......
USER node
EXPOSE 4000
CMD ["./start.sh"]For reference here is official node dockerfile:
https://github.com/nodejs/docker-node/blob/main/Dockerfile-slim.template#L3-L4
It is also recommened by docker-node Best Practices:
https://github.com/nodejs/docker-node/blob/main/docs/BestPractices.md#non-root-user
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels