apostrophecms / apostrophe-open-museum

Learn about ApostropheCMS via this boilerplate site built for an imaginary art museum.
http://apostrophecmsdemo.org
MIT License
37 stars 17 forks source link

optimize docker container build #60

Closed nofwayy closed 5 years ago

nofwayy commented 5 years ago

This MR add a .dockerignore file to avoid copying unwanted files and optimize the Docker build process.

Having npm install dissociated from the app copy step will allow docker to properly cache the dependencies when both package.json and package-lock.json haven't changed.

Splitting the Docker build in two phases will reduce the number of layers in the final Docker image.

Overall, the new Docker image weight 412.30 MiB instead of 503.26 MiB.

I'm pushing this as I'm using your new demo to build k8s/helm optimized setups for apostrophe.