Skip to content

Making docs image 40% smaller and also making python version upgrades easier for multi-stage builds.#2836

Merged
browniebroke merged 7 commits intocookiecutter:masterfrom
arnav13081994:dockerfile-docs
Dec 24, 2021
Merged

Making docs image 40% smaller and also making python version upgrades easier for multi-stage builds.#2836
browniebroke merged 7 commits intocookiecutter:masterfrom
arnav13081994:dockerfile-docs

Conversation

@arnav13081994
Copy link
Copy Markdown
Contributor

Description

I am proposing to use multi-stage builds for building the python part of Docs.

This can be done by installing all required OS and python dependencies and then to just copy over those files to the run stage. This would cause a nearly 35-40% reduction in size!

Checklist:

  • I've made sure that tests/test_cookiecutter_generation.py is updated accordingly (especially if adding or updating a template option)
  • I've updated the documentation or confirm that my change doesn't require any updates

Rationale

Smaller images are highly desirable because they would greatly reduce the time of re-deployment and deployment of containers and would also save a lot of time and money especially bandwidth costs.

@arnav13081994 arnav13081994 changed the title Dockerfile docs Making docs image 40% smaller and also making python version upgrades easier for multi-stage builds. Sep 17, 2020
It was enabled by default on pip 20.3, and the Docker image uses 21.2
Copy link
Copy Markdown
Member

@browniebroke browniebroke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've merged the latest changes from master and tweaked a couple of things.

@browniebroke browniebroke merged commit 0d8a91e into cookiecutter:master Dec 24, 2021
@browniebroke
Copy link
Copy Markdown
Member

Thank you for your contribution 🎉

@arnav13081994
Copy link
Copy Markdown
Contributor Author

Thanks @browniebroke

Happy to help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants