docker-node
docker-node copied to clipboard
Improve "Best Practices" regarding NODE_ENV
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.
setting NODE_ENV to production causes npm config production to be true
So, it would not install devDependencies