-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Update Dockerfile with secure base image and non-root user #24003
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- Use node:24-alpine base image - Run as non-root user (node) for security - Create /etc/todos directory with proper permissions
✅ Deploy Preview for docsdocker ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
The Dockerfile is now more complex that the original one. The extra steps:
either need to be explained, or they should be omitted and left for a later stage where optimizations, such as security / reducing image size, etc. can be described. |
|
@MikeMcC399 If you notice Parts 5 (Bind Mounts), 7 (Docker Compose), and 8 (Image-building best practices) all still use Regarding the USER entry in the Dockerfile - it's required. Otherwise, users will encounter permission issues. I can add 1-2 lines explaining what it is and why it is required. |
Updated the explanation of the Dockerfile to provide a detailed breakdown of its components and functionality.
|
@craig-osterhout @MikeMcC399 I will be raising a separate PR that replaces all occurances of Yarn with NPM in order to maintain consistency. |
Why not add the changes into this PR? They belong together. Also, if you are writing "npm", you should use lower case. See https://github.com/npm/cli#faq-on-branding. |
Description
Related issues or tickets
Reviews