-
Notifications
You must be signed in to change notification settings - Fork 58
[Feature] Integrate Docker-based deployment #5
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
Open
Mischback
wants to merge
114
commits into
development
Choose a base branch
from
feature/docker
base: development
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
This is just applied for the util environment. It is changed to use the provided requirements/development.txt
The project's requirements are automatically resolved during build step.
The build process is further refined, using a single 'builder' (base) to set up the virtual environment, that is then copied over into the final image.
Actually, this project will have more than one Makefile, reflecting different stages of development and usage of django-project-skeleton. 1) The Makefile, that is included in the main directory when you download/use the repo as Django's startproject template: This Makefile is used during development and primarily includes receipts to support development. However, this will be the Makefile just after downloading the skeleton. So it has to include a receipt to prepare the project for further usage. 2) The Makefile, that is used during the lifespan of the project: This Makefile should support project-specific development, testing and deployment until production usage.
This requires 'tput' to be installed on your system (most probably it is!), but will gracefully provide monochrome text, if it is not.
The actual deployment Makefile received a lot of love, including - comments, comments, documentation - switched from 'echo' to '/usr/bin/printf' for max compatibility - some minor manual testing of Makefile commands/targets docker-compose.yml was updated to include the new naming scheme for images built through the Makefile interface. The tagging may be controlled by Makefile variables, that also are set up to support templating by Django's startproject. To tag every build with an unique identifier, a custom shell script was added in the new ./bin directory. This script needs documentation and comments.
Success! The build process can now be launched directly from within this repo, no more need to use a seperate test bed. The current structure is deployed into a temporary tox environment, initialized and then the Docker build process is triggered. Images will be tagged with the sha1 tags of this repo.
The files are not yet fixed! This means, all Docker-related scripts are currently not working and need manual adaptation. Beside the moved files, this is also required for .dockerignore and most probably the Makefiles.
Currently, there are still errors in the images, so this is NOT WORKING.
Open
a) use the correct settings module b) default to use development settings, when executing 'manage.py' c) do not explicitly set the settings module in 'tox.ini', rely on the provided default value in 'manage.py'
The docker-specific settings were included into the production settings, with some documentation, why and how Django's logging is deactivated. It also includes a fix for ALLOWED_HOSTS, to work nicely in our Docker-based deployment, but should be working fine in other setups aswell.
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.
Integrating Docker
Architecture
Django
stdout
AdminEmailHandler
) is desirablePostgre
NGINX
Documentation
make init
including a documentation (which files get overwritten and why)tox
, nativeDjango
in a virtual environment, the concept of Docker-based staging and production deploymentscommon.py
anddevelopment.py
vs.production.py
)