Dockerfile 1.11 KB
Newer Older
Guilhem Saurel's avatar
Guilhem Saurel committed
1
FROM python:slim-buster
2
3
4
5
6
7

EXPOSE 8000

RUN mkdir /app
WORKDIR /app

Guilhem Saurel's avatar
Guilhem Saurel committed
8
9
ENV PYTHONUNBUFFERED=1

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
    curl \
Guilhem Saurel's avatar
Guilhem Saurel committed
13
    gcc \
Guilhem Saurel's avatar
Guilhem Saurel committed
14
    git \
Guilhem Saurel's avatar
Guilhem Saurel committed
15
    gnupg2 \
16
    graphviz \
Guilhem Saurel's avatar
Guilhem Saurel committed
17
    libldap2-dev \
18
    libpq-dev \
Guilhem Saurel's avatar
Guilhem Saurel committed
19
    libsasl2-dev \
20
    netcat-openbsd \
Guilhem Saurel's avatar
Guilhem Saurel committed
21
    msmtp \
Guilhem Saurel's avatar
Guilhem Saurel committed
22
 && curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add - \
Guilhem Saurel's avatar
Guilhem Saurel committed
23
 && echo "deb [arch=amd64] https://download.docker.com/linux/debian buster stable" >> /etc/apt/sources.list \
Guilhem Saurel's avatar
Guilhem Saurel committed
24
25
26
 && apt-get update -qq && apt-get install -qqy docker-ce \
 && git config --global user.email "rainboard@laas.fr" \
 && git config --global user.name "rainboard.laas.fr"
Guilhem Saurel's avatar
Guilhem Saurel committed
27

28
RUN pip3 install --no-cache-dir \
29
    gunicorn \
30
    ipython \
31
    pipenv \
Guilhem Saurel's avatar
Guilhem Saurel committed
32
    psycopg2-binary \
33
    python-memcached
34

35
36
37
ADD Pipfile Pipfile.lock ./
RUN pipenv install --system --deploy

38
39
ADD . .

Guilhem Saurel's avatar
   
Guilhem Saurel committed
40
CMD rm -f /opt/openrobots/etc/robotpkg.conf \
Guilhem Saurel's avatar
Guilhem Saurel committed
41
 && /srv/dashboard/robotpkg/bootstrap/bootstrap \
42
 && while ! nc -z postgres 5432; do sleep 1; done \
Guilhem Saurel's avatar
Guilhem Saurel committed
43
44
45
46
47
 && ./manage.py migrate \
 && ./manage.py collectstatic --no-input \
 && gunicorn \
    --bind 0.0.0.0 \
    dashboard.wsgi