Readdressing Docker Refinement#257
Merged
Merged
Conversation
MarkKoz
reviewed
Sep 21, 2019
MarkKoz
approved these changes
Sep 23, 2019
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

The last docker refinement resulted in uwsgi being installed from apt, which ended up causing an issue where the app was not discovered when the container was run. Due to that, it was set back to the original install through pip and building from source.
This PR applies another method instead, while also looking into the last few things that come to mind that would be able to improve the image speed and size.
uWSGI
A more python-friendly distribution package that is maintained by the original team,
pyuwsgi, was found after some looking around and presented an excellent and reliable way to ditch the build dependencies.The package is already built and has a standard whl available from pypi, allowing the build tools to be removed again while being an exact in-place install with the same behaviour as the original pip package.
Base Image
I took this chance to finally directly compare and evaluate the two mini-debian base images that were in discussion;
bitnami/python:3.7-prodand the official dockerhubpython:3.7-slimimages.The result was that
python:3.7-slimhad an approx 15% quicker build time, and the size was 4% smaller during the tests, so I've changed the base image over to it instead.Wiki & Git
Git was taking a fair amount of time and space, and it appeared to be only needed for the git dependancy
wiki, our temporary fork of the django-wiki repo for Django 2.2 compatibility.Once the main lib releases a package to pypi that has Django 2.2 compatibility, we will be removing this fork and using the normal package again. Since we're not about to change the version until then, I've added a .whl for our forked version and have it set in the Pipfile and Pipfile.lock.
The
build-wiki.Dockerfileandbuild-wiki.shfiles are only helpers for making the wiki whl file that I used in laziness and are not used for testing or production. They are simply here for reference and convenience.Improvements
The uncompressed size has dropped from 516.7MB to 310.9MB
The local build speed has dropped from 1:11 to 38s