loading...

re: How to debug Node.js in a Docker container VIEW POST

FULL DISCUSSION
 

Dear Alx,

Your tutorial is great. Why did you add "/usr/src/app/node_modules" in volumes. What is the purpose of it? because "/usr/src/app" contain every thing that we need.

 

Thank you. In you local machine in app folder you don't have node modules, so when you use mount your folder will override everything in /usr/src/app. The line you mentioned, sort of preventing overriding of node modules installed during the image build process.

 

You can do the same by adding node_modules to a .dockerignore file. 👍

No. dockerignore works only for the process of copying file during the build of the image and has nothing to do with mount.

code of conduct - report abuse