A dockerfile to run django
The official docker image for django is deprecated since 31 Dec 2016. Even that did not seem development friendly, since it generated images with a copied version of the project instead of a mounted project folder.
- Install docker ;-)
- Clone repository:
https://github.com/malcata/docker-django.git
- Configure required environment variables, eventually on a bash_profile file:
$ export SOURCE_DIR="<project source folder>"
- Generate the docker image
$ make build
- Add to the environment the following variables (.bash_profile or .bashrc):
export SOURCE_DIR?=~/source/project
# ONLY NEEDED FOR NEW PROJECTS
export PROJECT_NAME?=newproject
export DJANGO_SECRET_KEY?=pleasereplacethis
- (optional) First time to create the django project
$ make startproject
- Run the container
$ make run
- Use browser to access django http://localhost:8000
Check the Makefile for further details.
Please follow the Github flow process (branch, commits and pull request)...
The code in this repository, unless otherwise noted, is MIT licensed. See the 'LICENSE' file in this repository.