Skip to content

Making docs file smaller by around 40% using multi-stage builds#2824

Closed
arnav13081994 wants to merge 15 commits intocookiecutter:masterfrom
arnav13081994:docs-dockerfile
Closed

Making docs file smaller by around 40% using multi-stage builds#2824
arnav13081994 wants to merge 15 commits intocookiecutter:masterfrom
arnav13081994:docs-dockerfile

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.

@browniebroke
Copy link
Copy Markdown
Member

While this is a great improvement in #2815, especially for production image, I'm less convinced of the benefit of the docs image. This size improvement makes the Dockerfile a bit more complicated after all, but the docs image doesn't need to be deployed anywhere AFAIK, one can build it and just keep its output (which are a bunch of static files).

@arnav13081994
Copy link
Copy Markdown
Contributor Author

@browniebroke Agreed. I did this just to be consistent with the Django Dockerfile.

Comment thread CHANGELOG.md
Comment on lines +6 to +12
## [2020-09-14]
### Fixed
- Downgrade Celery to 4.4.6 ([#2829](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/2829))
### Updated
- Update sentry-sdk to 0.17.5 ([#2828](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/2828))
- Update coverage to 5.3 ([#2826](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/2826))
- Update django-storages to 1.10.1 ([#2825](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/2825))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you check how you've updated this PR? I think this shouldn't appear on it, it's already in master...

@arnav13081994
Copy link
Copy Markdown
Contributor Author

arnav13081994 commented Sep 17, 2020

@browniebroke I forgot to merge upstream changes with my repo and that caused all of that. I will merge and raise another PR.
Closing this.

Raised here: #2836

@arnav13081994 arnav13081994 deleted the docs-dockerfile branch September 17, 2020 04:40
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.

4 participants