andrecp/django-tutorial-docker-nginx-postgres(新しいタブで開きます)
主要言語: JavaScript
Django tutorial running with Nginx, Gunicorn, PostgreSQL and docker-compose
- star 数
- 148
- watcher 数
- 8
- fork 数
- 25
- issue 数
- 0
- 最終更新
- 2015/07/22
主要言語: JavaScript
Django tutorial running with Nginx, Gunicorn, PostgreSQL and docker-compose
This is Django tutorial in steroids, I wanted to go through the tutorial using a configuration that is more close to production.
I am running the django app with gunicorn, using postgres as the database, the django app is behind nginx and everything is running out of Docker containers orchastrated with docker-compose.
I've just finished going throught Django tutorial so the adventure on this repository is over, however have fun picking a start point:
Branch with reusuable-apps advanced tutorial
I am running this on a Macbook air running Yosemite with boot2docker.
docker-compose run django /bin/sh -c 'cd mysite;python manage.py migrate'Compose is a tool for defining and running multi-container applications with Docker. With Compose, you define a multi-container application in a single file, then spin your application up in a single command which does everything that needs to be done to get it running.
https://docs.docker.com/compose/
We have three containers: Nginx, Postgres and a Django App.
django
postgres
nginx
Created to make life easier:
use docker-compose run CONTAINER_NAME command for example:
Testing polls app
Running ls
Running Python directly
use docker-compose logs CONTAINER_NAME
This project first started as me following the awesome introduction from Andrew T. Baker at the PyCon US 2015 link