docker-node icon indicating copy to clipboard operation
docker-node copied to clipboard

Improve "Best Practices" regarding NODE_ENV

Open mpoettgen opened this issue 4 years ago • 1 comments

Problem

I just spent half a day trying to figure out, why trying to build an Angular project in Docker failed. I've followed the advice at Best Practices, not aware, that setting NODE_ENV to production causes npm not to install devDependencies.

Solution

The Best Practices guide should differentiate between using Node.js to build a Node.js based project (NODE_ENV=development) and to run a Node.js based project (NODE_ENV=production). Both can even be combined using multi-stage builds.

mpoettgen avatar Mar 04 '21 19:03 mpoettgen

setting NODE_ENV to production causes npm config production to be true image So, it would not install devDependencies

zWingz avatar Sep 26 '21 10:09 zWingz