Skip to content

Commit c4a55e5

Browse files
committed
optimizations to run.sh and Dockerfile
1 parent 27d624a commit c4a55e5

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

Dockerfile

+7-9
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
FROM debian:jessie
22
MAINTAINER Matt Bentley <[email protected]>
3-
RUN (echo "deb http://http.debian.net/debian/ jessie main contrib non-free" > /etc/apt/sources.list && echo "deb http://http.debian.net/debian/ jessie-updates main contrib non-free" >> /etc/apt/sources.list && echo "deb http://security.debian.org/ jessie/updates main contrib non-free" >> /etc/apt/sources.list)
4-
RUN apt-get update
53

6-
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential git python python-dev python-setuptools nginx sqlite3 supervisor
7-
RUN easy_install pip
8-
RUN pip install uwsgi
4+
RUN (apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential git python python-dev python-setuptools nginx sqlite3 supervisor)
5+
RUN (easy_install pip &&\
6+
pip install uwsgi)
97

108
ADD . /opt/django/
119

12-
RUN echo "daemon off;" >> /etc/nginx/nginx.conf
13-
RUN rm /etc/nginx/sites-enabled/default
14-
RUN ln -s /opt/django/django.conf /etc/nginx/sites-enabled/
15-
RUN ln -s /opt/django/supervisord.conf /etc/supervisor/conf.d/
10+
RUN (echo "daemon off;" >> /etc/nginx/nginx.conf &&\
11+
rm /etc/nginx/sites-enabled/default &&\
12+
ln -s /opt/django/django.conf /etc/nginx/sites-enabled/ &&\
13+
ln -s /opt/django/supervisord.conf /etc/supervisor/conf.d/)
1614

1715
RUN pip install -r /opt/django/app/requirements.txt
1816

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ mbentley/django-uwsgi-nginx
22
==================
33

44
docker image for django (uwsgi) & nginx
5-
based off of stackbrew/debian:jessie
5+
based off of debian:jessie
66

77
To pull this image:
88
`docker pull mbentley/django-uwsgi-nginx`

run.sh

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
#!/bin/bash
22

3+
set -e
4+
35
MODULE=${MODULE:-website}
46

57
sed -i "s#module=website.wsgi:application#module=${MODULE}.wsgi:application#g" /opt/django/uwsgi.ini
68

79
if [ ! -f "/opt/django/app/manage.py" ]
810
then
9-
echo "creating basic django project (module: ${MODULE})"
10-
django-admin.py startproject ${MODULE} /opt/django/app/
11+
echo "creating basic django project (module: ${MODULE})"
12+
django-admin.py startproject ${MODULE} /opt/django/app/
1113
fi
1214

13-
/usr/bin/supervisord
15+
exec /usr/bin/supervisord

0 commit comments

Comments
 (0)