diff --git a/api/Dockerfile.debian b/api/Dockerfile.debian index b5ee1a1d1..c94703057 100644 --- a/api/Dockerfile.debian +++ b/api/Dockerfile.debian @@ -2,6 +2,8 @@ FROM python:3.11-slim AS builder ARG POETRY_VERSION=1.8 +ENV DEBIAN_FRONTEND=noninteractive + ENV VIRTUAL_ENV=/venv ENV PATH="/venv/bin:$PATH" @@ -16,17 +18,18 @@ ENV POETRY_CACHE_DIR=/opt/.cache RUN pip install "poetry==${POETRY_VERSION}" -RUN apt update; \ - apt install -y \ - build-essential \ - python3-dev \ - libldap-dev \ - libsasl2-dev \ - slapd \ - ldap-utils \ - tox \ - lcov \ - valgrind +RUN --mount=type=cache,target=/var/lib/apt/lists \ + apt update; \ + apt install -y \ + build-essential \ + python3-dev \ + libldap-dev \ + libsasl2-dev \ + slapd \ + ldap-utils \ + tox \ + lcov \ + valgrind WORKDIR /app @@ -40,18 +43,22 @@ FROM python:3.11-slim AS runtime ARG POETRY_VERSION=1.8 +ENV DEBIAN_FRONTEND=noninteractive + ENV VIRTUAL_ENV=/venv ENV PATH="/venv/bin:$PATH" -RUN apt update; apt install -y \ - ffmpeg \ - gettext \ - libjpeg-dev \ - libldap-2.5-0 \ - libmagic1 \ - libpq5 \ - libxml2 \ - libxslt1.1 +RUN --mount=type=cache,target=/var/lib/apt/lists \ + apt update; \ + apt install -y \ + ffmpeg \ + gettext \ + libjpeg-dev \ + libldap-2.5-0 \ + libmagic1 \ + libpq5 \ + libxml2 \ + libxslt1.1 RUN pip install "poetry==${POETRY_VERSION}" COPY --from=builder ${VIRTUAL_ENV} ${VIRTUAL_ENV}