You've already forked snikket-web-portal
Currently the Dockerfile has a single RUN directive with all the needed commands in it. This optimizes for image size by not creating too many "layers" (which are only additive). However it means the result that gets cached can basically never be reused, because any change to the source code will need to execute the whole RUN block again. This commit switches to a docker "multi-stage" build, where we have a build image that is separate from the final one that gets published. The build image can be cached locally, and size is no longer a significant concern. This approach allows the single RUN command to be split up into multiple RUN commands that only execute when strictly needed (i.e. when their result is not cached locally). This drastically improves the build time when rebuilding the image after a simple code change, because the build image doesn't have to install all the apt packages, for example. This leads to a nicer developer experience when using docker locally for development and testing.
1.7 KiB
1.7 KiB