Dockerfile 1.19 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
    libldap2-dev \
17
    libpq-dev \
Guilhem Saurel's avatar
Guilhem Saurel committed
18
    libsasl2-dev \
19
    netcat-openbsd \
Guilhem Saurel's avatar
Guilhem Saurel committed
20
    msmtp \
Guilhem Saurel's avatar
Guilhem Saurel committed
21
 && curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add - \
Guilhem Saurel's avatar
Guilhem Saurel committed
22
 && echo "deb [arch=amd64] https://download.docker.com/linux/debian buster stable" >> /etc/apt/sources.list \
Guilhem Saurel's avatar
Guilhem Saurel committed
23
24
25
 && 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
26

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

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

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