Docker and CI/CD · Middle · Question 9 of 75
After USER node, the app can't write to /app. What's a common fix?
- 1Run
chmod 777 -R /in the final stage of the Dockerfile - 2Switch back to
USER rootright before theCMDline - ✓Correct answer: Copy files with
COPY --chown=node:nodeor give that user the folder
Explanation
Files copied as root stay owned by root. Set ownership during the copy, and prefer writing only to specific folders or volumes.