TerriaMap icon indicating copy to clipboard operation
TerriaMap copied to clipboard

Dockerfile using alpine

Open davidedelerma opened this issue 5 years ago • 3 comments

Using Apine to get a smaller image and runnin npm install at built time to pull the newest versions of the libraries. Using Alpine resulted in ~50% size reduction of the image compared to data61/terria-terriamap

davidedelerma avatar Jun 12 '20 15:06 davidedelerma

Unfortunately we can't merge this PR as is - our Dockerfile is written as a way to package up an immutable build and this undoes most of that. For some of our maps, we specify a set of dependencies that we want at time of building/deploying/releasing a given TerriaMap and commit that lockfile - and allowing dockerfile to pull in newer versions of libraries will introduce an u-tracked (bar looking at the lockfile inside a given image) and different set of dependencies.

why we're not already using alpine

One reason would be having to check puppeteer deps again, size reduction is a really good goal but this PR would better suit a directory/dockerfile targetted for running in this fashion, or to separate just the size shrink change from the dependency-update change

soyarsauce avatar Jun 15 '20 03:06 soyarsauce

@soyarsauce so just to clarify, are you suggesting that @davidedelerma should set up a separate Dockerfile in deploy/docker-alternate/ or something? rather than modify the primary one?

KeyboardSounds avatar Jun 15 '20 03:06 KeyboardSounds

@soyarsauce @KeyboardSounds I pushed some changes that follow up your suggestions. Now there is a dockerfile that mimic the behaviour of the original one, but based on Alpine to reduce the size. And then in the docker-alternate folder there is the other dockerfile still based on Alpine but that installs the packages defined in package.json at build time.

davidedelerma avatar Jun 15 '20 10:06 davidedelerma