Dockerfile 830 Bytes
Newer Older
Guilhem Saurel's avatar
Guilhem Saurel committed
1
FROM python:jessie
2
3
4
5
6
7

EXPOSE 8000

RUN mkdir /app
WORKDIR /app

Guilhem Saurel's avatar
Guilhem Saurel committed
8
ADD requirements.txt ./
Guilhem Saurel's avatar
Guilhem Saurel committed
9

10
RUN apt-get update -qq && apt-get install -qqy \
Guilhem Saurel's avatar
Guilhem Saurel committed
11
    apt-transport-https \
Guilhem Saurel's avatar
Guilhem Saurel committed
12
    git \
13
    graphviz \
14
15
    libpq-dev \
    netcat-openbsd \
Guilhem Saurel's avatar
ssmtp    
Guilhem Saurel committed
16
    ssmtp \
Guilhem Saurel's avatar
Guilhem Saurel committed
17
18
19
20
21
 && curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add - \
 && echo "deb [arch=amd64] https://download.docker.com/linux/debian jessie stable" >> /etc/apt/sources.list \
 && apt-get update -qq && apt-get install -qqy docker-ce

RUN pip3 install --no-cache-dir -r requirements.txt \
22
    gunicorn \
Guilhem Saurel's avatar
Guilhem Saurel committed
23
    psycopg2-binary \
24
    python-memcached
25
26
27

ADD . .

28
29
CMD /srv/dashboard/robotpkg/bootstrap/bootstrap \
 && while ! nc -z postgres 5432; do sleep 1; done \
Guilhem Saurel's avatar
Guilhem Saurel committed
30
31
32
33
34
 && ./manage.py migrate \
 && ./manage.py collectstatic --no-input \
 && gunicorn \
    --bind 0.0.0.0 \
    dashboard.wsgi