-
Notifications
You must be signed in to change notification settings - Fork 21
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
Renovate/multi stage docker #466
Renovate/multi stage docker #466
Conversation
Also related to #424 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more great suggestion! Thank you!
It's not quite ready because we can't run the tests without the dev modules installed by poetry. I tried with them installed but I got errors :
FAILED tapir/coop/tests/test_send_membership_confirmation_email.py::TestSendMembershipConfirmationEmail::test_sends_correct_mail_to_investing_member - AttributeError: function/symbol 'pango_context_set_round_glyph_positions' not found in library 'libpango-1.0.so.0': /usr/lib/x86_64-linux-gnu/libpango-1.0.so.0: undefined symbol: pango_context_set_round_glyph_positions
Could you look into them?
@@ -16,9 +16,7 @@ services: | |||
|
|||
web: | |||
build: . | |||
command: bash -c "poetry install && | |||
poetry run python manage.py compilemessages --ignore \".venv\" && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CONTRIBUTING.md
suggests restarting the container so that compilemessages
runs, if we don't run compilemessages on start we should update the doc.
Thanks for having a good look! We could create an extra stage with dev-dependencies and build it for testing only, e.g.
Would that be possible with Github actions to override |
Since both GitHub actions and local development use the same docker-compose.yml file, but production uses a separate one, as long as we specify in the docker-compose file that is in this repo that we want the test stuff installed too, we should be fine? |
I'll close it and retry later |
Changed the Dockerfile to a multi-stage docker in order to reduce image size from 1.54GB to roughly 471 MB and eliminate Docker vulnerability errors.
Structure of the image is that .venv lies in root and the app in app. This made it easier for Pycharm to detect the venv-executable when Debugging and
poetry run
is not necessary anymore.I'm not sure if all packages are installed in the final build (maybe SSL is missing?).