Closed JamieMason closed 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
Updated to include your point on cache-min, cheers! agree re: private repos too.
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
Where we currently have
FROM node:4.2.4
, reference a base image which sets up theshrinkpack
test environment.In the
Dockerfile
for that base image;npm cache add npm@x.x.x
for every version ofnpm
we're interested in.sinopia
).npm install
against thetest/package.json
.npm rebuild
might be needed.See also: https://github.com/JamieMason/shrinkpack/pull/47#issuecomment-228684289 from @5id.