Dockerfile 467 Bytes
Newer Older
1
FROM python
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
    git \
12
13
    libpq-dev \
    netcat-openbsd \
Guilhem Saurel's avatar
Guilhem Saurel committed
14
 && pip3 install --no-cache-dir -r requirements.txt \
15
16
17
    gunicorn \
    psycopg2 \
    python-memcached
18
19
20

ADD . .

Guilhem Saurel's avatar
Guilhem Saurel committed
21
22
23
24
25
26
CMD while ! nc -z postgres 5432; do sleep 1; done \
 && ./manage.py migrate \
 && ./manage.py collectstatic --no-input \
 && gunicorn \
    --bind 0.0.0.0 \
    dashboard.wsgi