View on GitHub

django fullstack

Full stack django example project build on multiple docker containers ready for development and production.

Download this project as a .zip file Download this project as a tar.gz file

django-fullstack

Docker Repository on Quay.io

Full stack django example project build on multiple docker containers ready for development and production.

Batteries

Create your own

This repository is an instance of cookiecutter-django-fullstack. Check it out to create your own django fullstack project.

Development

MacOS X

Setup

brew install docker boot2docker
sudo pip install docker-compose
boot2docker upgrade
boot2docker init

In case of errors, try boot2docker delete && boot2docker init again. For more details, read documentation.

Create host alias for current docker host IP with echo $(boot2docker ip) dockerhost | sudo tee -a /etc/hosts. IP can change in future, update it in /etc/hosts if necessary.

Running

boot2docker start
$(boot2docker shellinit)
docker-compose up

Deployment

Docker Registry

Register your django app image (e.g. this repo) to a docker registry. E.g. quay.io, which builds your container images on git push.

  1. Push your repository to GitHub
  2. Create an account on quay.io
  3. Add a repository and link it to your GitHub repository
  4. Update images of django and worker in tutum.yml to quay.io/YOURUSER/YOURDJANGOPROJECT

Managed Cloud Deployment

You can deploy this app in many different ways of course. E.g. just checking it out on a server and running it with docker-compose (not recommended for production use and that's so 2014). So we use tutum.co to manage our cloud (nodes on e.g. DigitalOcean or Amazon) and deployment of our docker images.

  1. Create an account on tutum.co
  2. Create at least 1 node (e.g. on DigitalOcean). How many nodes you need and which containers are best on which nodes depends heavy on your kind of application. But you can change this later very easy thanks to tutum.co
  3. Update VIRTUAL_HOST of django in tutum.ymlto nginx.YOURDJANGOPROJECT.YOURUSER.svc.tutum.io and use it to create a new stack on tutum.co
  4. Start it and browse to http://nginx.YOURDJANGOPROJECT.YOURUSER.svc.tutum.io/

Todos:

Tipps & Tricks