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

EXPOSE 8000

WORKDIR /app

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

9
RUN apt-get update -qq && apt-get install -qqy \
Guilhem Saurel's avatar
Guilhem Saurel committed
10
    apt-transport-https \
Guilhem Saurel's avatar
Guilhem Saurel committed
11
    build-essential \
Guilhem Saurel's avatar
Guilhem Saurel committed
12
    curl \
Guilhem Saurel's avatar
Guilhem Saurel committed
13
    git \
Guilhem Saurel's avatar
Guilhem Saurel committed
14
    gnupg2 \
15
    graphviz \
Guilhem Saurel's avatar
Guilhem Saurel committed
16
    libffi-dev \
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 \
Guilhem Saurel's avatar
Guilhem Saurel committed
31
    poetry \
Guilhem Saurel's avatar
Guilhem Saurel committed
32
    psycopg2-binary \
33
    python-memcached
34

Guilhem Saurel's avatar
Guilhem Saurel committed
35
36
37
ADD pyproject.toml poetry.lock ./
RUN poetry config virtualenvs.create false --local \
 && poetry install --no-dev --no-root --no-interaction --no-ansi
38

39
40
ADD . .

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