-
Notifications
You must be signed in to change notification settings - Fork 112
Expand file tree
/
Copy pathDockerfile
More file actions
61 lines (48 loc) · 2.01 KB
/
Dockerfile
File metadata and controls
61 lines (48 loc) · 2.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
FROM deis/base:latest
MAINTAINER Gabriel A. Monroy <gabriel@opdemand.com>
# install required system packages
RUN apt-get update && \
apt-get install -yq python-dev libpq-dev libyaml-dev
# install recent pip
RUN wget -qO- https://raw.githubusercontent.com/pypa/pip/1.5.5/contrib/get-pip.py | python -
# HACK: install git so we can install bacongobbler's fork of django-fsm
RUN apt-get install -yq git
# install requirements before ADD to cache layer and speed build
RUN pip install celery==3.1.11 \
Django==1.6.4 \
django-allauth==0.15.0 \
git+https://github.com/deis/django-fsm@add-exception-handling \
django-guardian==1.1.1 \
django-json-field==0.5.5 \
django-yamlfield==0.5 \
djangorestframework==2.3.13 \
gunicorn==18.0 \
psycopg2==2.5.2 \
python-etcd==0.3.0 \
PyYAML==3.10 \
redis==2.9.1 \
static==1.0.2 \
South==0.8.4
# install openssh-client for temporary fleetctl wrapper
RUN apt-get install -yq openssh-client
# install latest etcdctl including no-sync options
RUN wget -q https://s3-us-west-2.amazonaws.com/deis/etcdctl.no-sync -O /usr/local/bin/etcdctl
RUN chmod +x /usr/local/bin/etcdctl
# clone the project into /app
ADD . /app
# install python requirements
RUN pip install -r /app/requirements.txt
# Create static resources
RUN /app/manage.py collectstatic --settings=deis.settings --noinput
# add a deis user that has passwordless sudo (for now)
RUN useradd deis --groups sudo --home-dir /app --shell /bin/bash
RUN sed -i -e 's/%sudo\tALL=(ALL:ALL) ALL/%sudo\tALL=(ALL:ALL) NOPASSWD:ALL/' /etc/sudoers
RUN chown -R deis:deis /app
# create directory for confd templates
RUN mkdir -p /templates && chown -R deis:deis /templates
# create directory for logs
RUN mkdir -p /var/log/deis && chown -R deis:deis /var/log/deis
# define the execution environment
WORKDIR /app
CMD ["/app/bin/boot"]
EXPOSE 8000