Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 18 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,31 @@

from ubuntu:precise

maintainer Dockerfiles
maintainer baxeico

run echo "deb http://us.archive.ubuntu.com/ubuntu/ precise-updates main restricted" | tee -a /etc/apt/sources.list.d/precise-updates.list

# update packages
run apt-get update
run apt-get install -y git
run apt-get install -y python python-dev python-setuptools
run apt-get install -y nginx supervisor

# install required packages
run apt-get install -y python python-dev python-setuptools python-software-properties
run apt-get install -y sqlite3
run apt-get install -y supervisor

# add nginx stable ppa
run add-apt-repository -y ppa:nginx/stable
# update packages after adding nginx repository
run apt-get update
# install latest stable nginx
run apt-get install -y nginx

# install pip
run easy_install pip

# install uwsgi now because it takes a little while
run pip install uwsgi

# install nginx
run apt-get install -y python-software-properties
run apt-get update
run add-apt-repository -y ppa:nginx/stable
run apt-get install -y sqlite3

# install our code
add . /home/docker/code/

Expand All @@ -47,7 +53,8 @@ run pip install -r /home/docker/code/app/requirements.txt

# install django, normally you would remove this step because your project would already
# be installed in the code/app/ directory
run django-admin.py startproject website /home/docker/code/app/
run django-admin.py startproject website /home/docker/code/app/
run cd /home/docker/code/app && ./manage.py syncdb --noinput

expose 80
cmd ["supervisord", "-n"]
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,21 @@ elinimating overhead.
Most of this setup comes from the excellent tutorial on
https://uwsgi.readthedocs.org/en/latest/tutorials/Django_and_nginx.html

This repo is a fork of https://github.com/dockerfiles/django-uwsgi-nginx,
I made some fixes to have the image working out-of-the-box.

Feel free to clone this and modify it to your liking. And feel free to
contribute patches.

### Build and run
* docker build -t webapp .
* docker run -d webapp
* docker run -d -p 80:80 webapp

### Test

`curl localhost`

You should see the HTML source of Django welcome page.

### How to insert your application

Expand Down