Skip to content

Commit

Permalink
added Dockerfile and wsgi.py
Browse files Browse the repository at this point in the history
  • Loading branch information
kencochrane committed Aug 19, 2013
1 parent b3e052f commit b9a41ca
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 0 deletions.
1 change: 1 addition & 0 deletions .docker/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
supervisord -c /opt/supervisor.conf -n
20 changes: 20 additions & 0 deletions .docker/supervisor.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[supervisord]
nodaemon=true

[program:app]
priority=10
directory=/opt/apps/djdocker
command=/usr/local/bin/uwsgi
--http-socket 0.0.0.0:8000
-p 4
-b 32768
-T
--master
--max-requests 5000
-H /opt/ve/djdocker
--static-map /static=/opt/apps/djdocker/static
--static-map /static=/opt/ve/djdocker/lib/python2.7/site-packages/django/contrib/admin/static
--module wsgi:application
user=root
autostart=true
autorestart=true
18 changes: 18 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM ubuntu:12.10
MAINTAINER Ken Cochrane "[email protected]"
RUN apt-get -qq update
RUN apt-get install -y python-dev python-setuptools supervisor git-core
RUN easy_install pip
RUN pip install virtualenv
RUN pip install uwsgi
RUN virtualenv --no-site-packages /opt/ve/djdocker
ADD . /opt/apps/djdocker
ADD .docker/supervisor.conf /opt/supervisor.conf
ADD .docker/run.sh /usr/local/bin/run
RUN (cd /opt/apps/djdocker && git remote rm origin)
RUN (cd /opt/apps/djdocker && git remote add origin https://github.com/kencochrane/django-docker.git)
RUN /opt/ve/djdocker/bin/pip install -r /opt/apps/djdocker/requirements.txt
RUN (cd /opt/apps/djdocker && /opt/ve/shipyard/bin/djdocker manage.py syncdb --noinput)

EXPOSE 8000
CMD ["/bin/sh", "-e", "/usr/local/bin/run"]
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,10 @@ django-docker
=============

Demo Django App using Docker


Dockerfile
----------
Use this to build a new image

$ sudo docker build .
2 changes: 2 additions & 0 deletions wsgi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from django_docker import wsgi
application = wsgi.application

0 comments on commit b9a41ca

Please sign in to comment.