DEV Community

Discussion on: How to Dockerize a Node app and deploy to Heroku

Collapse
 
samshpakov profile image
Sam Shpakov

Why install npm if the installation is written in the dockerfile. For this, docker was created so that you do not need to install anything on the machine, in docker everything should be installed by itself at startup.

Collapse
 
pacheco profile image
Thiago Pacheco

Yes, that is true Sam. But in the end, the result will be the same while doing that in the dev environment because, as we have a volume pointing to the local file system, any installation in the container or in the local system will end up creating the node_modules folder in the local file system anyway.
There are implementations to avoid that, but for simplicity matters of this article, I decided to keep it as is.

Collapse
 
samshpakov profile image
Sam Shpakov

Can you post a link to this implementation?