docker-node
docker-node copied to clipboard
Update Best Practices to include note about chown on COPY
Description
When implementing the advice on the best practice page, I was struggling to get my code to execute. After some debugging I realized that the node user did not have enough permissions to access my files.
Motivation and Context
We should include explicit advice to easily give node user access to the files which most users will do via a COPY command in their Dockerfile. If they're doing it via a bind mount, the same advice will get them thinking about file permissions.
Testing Details
As this is a docs change, no code tests are done, but I did confirm that the advice I'm adding does indeed work.
Note - I didn't run any of the tests (All new and existing tests passed) as I'm just making an edit to an .md file.
Example Output(if appropriate)
Types of changes
- [x] Documentation
- [ ] Version change (Update, remove or add more Node.js versions)
- [ ] Variant change (Update, remove or add more variants, or versions of variants)
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] Other (none of the above)
Checklist
- [x] My code follows the code style of this project.
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [x] I have read the CONTRIBUTING.md document.
- [ ] All new and existing tests passed.