Thursday 4 May 2017

Speed up NPM install in Docker container

We use the standard practices of not including node_modules in version control. However, when moving through the CI/CD pipeline, we have to reinstall NPM dependencies in several places and it makes everything very slow.

Is there a way to somehow cache NPM dependencies with Docker? I searched Google "docker cache npm dependencies" and the first hit from 2014 yielded a dead link.

Nothing else of much value came up.

One solution is to include node_modules in version control, but I think that would be a huge mistake. I think caching the dependencies somehow would be the best option.



via Alexander Mills

No comments:

Post a Comment