JamieMason / shrinkpack

Fast, resilient, reproducible builds with npm install.
https://www.npmjs.com/package/shrinkpack
MIT License
793 stars 38 forks source link

Speed up Dockerised tests #52

Closed JamieMason closed 8 years ago

JamieMason commented 8 years ago

I'm really new to Docker so excuse me if any of the following is plain wrong, help or contributions welcome.

I think a lot of gains can be made by making better use of the Dockerfile, by moving things we wait for during the run phase into the build phase.

Notes/Ideas

See also: https://github.com/JamieMason/shrinkpack/pull/47#issuecomment-228684289 from @5id.

5id commented 8 years ago

I experimented with something similar where I moved the npm install of the control folder into the dockerfile, before realising that it stuffed up supporting different npm versions; so I think that's a much better way to tackle it.

You'll likely need to change the config cache-min to be something high so npm doesn't try to refetch.

Running the caching proxy in the same Dockerfile is possible, though you might find it makes it a bit messy. Potentially you could prime the local cache with an npm install to get a small bump to avoid using the proxy, but the downside of not using something like sinopia is the lack of ability to test private repos like we need for #47

JamieMason commented 8 years ago

Updated to include your point on cache-min, cheers! agree re: private repos too.