Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use 'pip --no-cache' and remove '*.pyc' files after installation #13

Merged
merged 2 commits into from
Apr 26, 2020
Merged

Use 'pip --no-cache' and remove '*.pyc' files after installation #13

merged 2 commits into from
Apr 26, 2020

Conversation

pmav99
Copy link
Contributor

@pmav99 pmav99 commented Sep 12, 2019

With the proposed patch the size of the images get reduced by ~15MB each, which for the alpine-based images translates into more than 10% of the total size.

If you want I can make a Pull Request for uvicorn-gunicorn-fastapi-docker, too

@tiangolo tiangolo merged commit 6ede51c into tiangolo:master Apr 26, 2020
@tiangolo
Copy link
Owner

Thanks! I see the documented option is --no-cache-dir, so I updated it to use that.

I'm not sure about removing *.pyc files, so let's leave it as the simplest change for now.

Thanks for your contribution! 🚀 🍰

@pmav99
Copy link
Contributor Author

pmav99 commented Apr 26, 2020

just for the record, what is your concern about the *.pyc files?

@tiangolo
Copy link
Owner

tiangolo commented Jun 5, 2020

That they are created either way while running, so adding extra logic to do something that might not actually do much would end up adding extra complexity without a very clear benefit.

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