:ship: A recipe for building 12-factor Python / Django web apps with multi-container Docker and deploying to Amazon AWS using Elastic Beanstalk.
:ship: A recipe for building 12-factor Python / Django web apps with multi-container Docker and deploying to Amazon AWS using Elastic Beanstalk.
The aim of Dockdj is to provide an example of how to quickly create a Django web application following the Twelve Factor App principals.
The Twelve Factors
This repo contains a simple Python Django 1.8 web app as well as the configuration for both Django and NGINX Docker images. There are also some Bash scripts to help automate the build, release and deploy process.
Stack
This document assumes you are running OS X. These are the requirements
needed by the bin/install
script;
Additionally these requirements are installed:
These steps will get you running locally:
./bin/install
will provision your local development machine for
the first time. It willenvironments/dev/.env.example
to environments/dev/.env
and
edit the values. Please make sure to change the following keys:ENV_SECRET_KEY
create your own Django secret
key
ENV_CDN
to your Docker host IP: docker-machine ip docker-vm
ENV_AWS_EB_ENVIRONMENT_NAME
to your Amazon AWS Elastic Beanstalk
environment nameENV_DOCKER_HUB_REPO_PATH
to your Docker repo (Create one if you
plan to publish images to Docker Hub.)pyvenv environments/dev/pyvenv
./bin/image dev build
will create "dev" Docker images with all
dependencies installed../bin/stevedore dev start
will run the dev Docker containers, open
the browser, and tail the logs. At this point you're viewing running
source code!ctrl+c
stops the logs ./bin/stevedore dev stop
will stop the Docker
containers../bin/stevedore dev logs
resumes log tailing../bin/stevedore dev build:dev
You can typically connect to your web application at: http://192.168.99.100/xyzzy.
You should now be up and running. Welcome.
Read more about deploying with Amazon AWS Elastic Beanstalk, version numbering, running deployments, hotfix / patch deployments, Docker Hub, and more on the Deployments wiki page.
Read more about the set of tools for managing, testing and deploying.
MIT