11FROM deis/base:latest
2- MAINTAINER Gabriel A. Monroy <gabriel @opdemand.com>
2+ MAINTAINER OpDemand <info @opdemand.com>
33
44# install required system packages
55RUN apt-get update && \
@@ -11,47 +11,35 @@ RUN wget -qO- https://raw.githubusercontent.com/pypa/pip/1.5.5/contrib/get-pip.p
1111# HACK: install git so we can install bacongobbler's fork of django-fsm
1212RUN apt-get install -yq git
1313
14- # install requirements before ADD to cache layer and speed build
15- RUN pip install celery==3.1.11 \
16- Django==1.6.4 \
17- django-allauth==0.15.0 \
18- git+https://github.com/deis/django-fsm@add-exception-handling \
19- django-guardian==1.1.1 \
20- django-json-field==0.5.5 \
21- django-yamlfield==0.5 \
22- djangorestframework==2.3.13 \
23- gunicorn==18.0 \
24- psycopg2==2.5.2 \
25- python-etcd==0.3.0 \
26- PyYAML==3.10 \
27- redis==2.9.1 \
28- static==1.0.2 \
29- South==0.8.4
30-
3114# install openssh-client for temporary fleetctl wrapper
3215RUN apt-get install -yq openssh-client
3316
34- # clone the project into /app
35- ADD . /app
36-
37- # install python requirements
38- RUN pip install -r /app/requirements.txt
39-
40- # Create static resources
41- RUN /app/manage.py collectstatic --settings=deis.settings --noinput
42-
4317# add a deis user that has passwordless sudo (for now)
4418RUN useradd deis --groups sudo --home-dir /app --shell /bin/bash
4519RUN sed -i -e 's/%sudo\t ALL=(ALL:ALL) ALL/%sudo\t ALL=(ALL:ALL) NOPASSWD:ALL/' /etc/sudoers
46- RUN chown -R deis:deis /app
20+
21+ # create a /app directory for storing application data
22+ RUN mkdir -p /app && chown -R deis:deis /app
4723
4824# create directory for confd templates
4925RUN mkdir -p /templates && chown -R deis:deis /templates
5026
5127# create directory for logs
5228RUN mkdir -p /var/log/deis && chown -R deis:deis /var/log/deis
5329
54- # define the execution environment
55- WORKDIR /app
30+ # define execution environment
5631CMD ["/app/bin/boot" ]
5732EXPOSE 8000
33+
34+ # define work environment
35+ WORKDIR /app
36+
37+ # install dependencies
38+ ADD requirements.txt /app/requirements.txt
39+ RUN pip install -r /app/requirements.txt
40+
41+ # clone the project into /app
42+ ADD . /app
43+
44+ # Create static resources
45+ RUN /app/manage.py collectstatic --settings=deis.settings --noinput
0 commit comments