-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
56 lines (47 loc) · 1.72 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
FROM python:bookworm
EXPOSE 8000
WORKDIR /app
ENV POETRY_VIRTUALENVS_IN_PROJECT=true PYTHONUNBUFFERED=1 PATH=/root/.local/bin:$PATH
CMD while ! nc -z postgres 5432; do sleep 1; done \
&& poetry run ./manage.py migrate \
&& poetry run ./manage.py collectstatic --no-input \
&& poetry run gunicorn \
--bind 0.0.0.0 \
dashboard.wsgi
RUN --mount=type=cache,sharing=locked,target=/var/cache/apt \
--mount=type=cache,sharing=locked,target=/var/lib/apt \
--mount=type=cache,sharing=locked,target=/root/.cache \
apt-get update -y && DEBIAN_FRONTEND=noninteractive apt-get install -qqy --no-install-recommends \
apt-transport-https \
build-essential \
gettext \
curl \
git \
gnupg2 \
graphviz \
libffi-dev \
libldap2-dev \
libpq-dev \
libsasl2-dev \
msmtp \
netcat-openbsd \
python-is-python3 \
python3-dev \
python3-pip \
python3-venv \
&& curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add - \
&& echo "deb [arch=amd64] https://download.docker.com/linux/debian bookworm stable" >> /etc/apt/sources.list \
&& apt-get update -qq && apt-get install -qqy docker-ce \
&& git config --global user.email "[email protected]" \
&& git config --global user.name "rainboard.laas.fr" \
&& python -m pip install -U pip \
&& python -m pip install -U pipx \
&& python -m pipx install poetry
ADD pyproject.toml poetry.lock ./
RUN --mount=type=cache,sharing=locked,target=/root/.cache \
poetry install --with prod --no-root --no-interaction --no-ansi
RUN mkdir -p /srv/dashboard \
&& git -C /srv/dashboard clone https://github.com/gepetto/robotpkg
ADD . .
RUN rm -f /opt/openrobots/etc/robotpkg.conf \
&& /srv/dashboard/robotpkg/bootstrap/bootstrap \