Sign inSign up

malcata/docker-django

By malcata

•Updated over 9 years ago

A dockerfile to run django.The official image (https://hub.docker.com/_/django/) is deprecated.

Image
0

141

malcata/docker-django repository overview

⁠docker-django

A dockerfile to run django

⁠Why

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.

⁠How to install

  1. Install docker ;-)
  2. Clone repository:
https://github.com/malcata/docker-django.git
  1. Configure required environment variables, eventually on a bash_profile file:
$ export SOURCE_DIR="<project source folder>"

⁠Usage

  1. Generate the docker image
$ make build
  1. 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
  1. (optional) First time to create the django project
$ make startproject
  1. Run the container
$ make run
  1. Use browser to access django http://localhost:8000⁠

Check the Makefile⁠ for further details.

⁠Contributing

Please follow the Github flow process (branch, commits and pull request)...

⁠License

The code in this repository, unless otherwise noted, is MIT licensed. See the 'LICENSE'⁠ file in this repository.

Tag summary

Content type

Image

Digest

Size

287.5 MB

Last updated

over 9 years ago

docker pull malcata/docker-django