feat: improved layered dockerfile and dockerignore#2236
feat: improved layered dockerfile and dockerignore#2236alext-extracellular wants to merge 4 commits intofrangoteam:masterfrom
Conversation
|
Hi @alext-extracellular Thanks for the contribution. I tested the Docker build locally and the resulting image size is around 7.3GB, which is significantly larger than the current image (~4GB). It seems that some large directories might still be copied into the image. Could you double-check the .dockerignore and the Dockerfile layers? Once the image size is actually reduced we can review it again. |
|
Wow that is quite large, yes probably some differences in what is in our personal repos, I will try to fix that. Here is a depth 2 tree of my repo: @unocelli If you can, it would be handy to see a tree of ur repo |
|
OK, I have updated the dockerfile and dockerignore. I have tested by cloning a fresh repo and running the build, the output is below: Make sure you are using the .dockerignore, otherwise some large stuff might get copied into the output. |
📌 Description
This PR refactors the dockerfile in order to build a much smaller image (2.4gb -> 540 MB), and to also make use of build layer caching for faster repeated builds.
The git repository is no longer cloned into the image and it is assumed it is being built from within the repo.
This allows building from different tags and branches as well, and should still work in CI.
This is needed because the image was way too large before and took ages to build.
🧪 Type of Change
Please mark the relevant option:
🚫 Build Artifacts Check
Please confirm:
/client/dist🔍 Checklist
📚 Documentation Checklist (if applicable)
mkdocs serveimages/example.png)mkdocs.yml(if required)📝 Additional Notes
Add any other context or screenshots here.