Changes the Dockerfile to use pipenv and the releases to use pipenv, removing the need for a requirements.txt

This commit is contained in:
Trenton Holmes
2022-07-20 09:44:12 -07:00
parent 8c7afc5646
commit e721092c2a
4 changed files with 47 additions and 131 deletions

View File

@@ -175,9 +175,11 @@ RUN --mount=type=bind,from=qpdf-builder,target=/qpdf \
&& python3 -m pip install --no-cache-dir /psycopg2/usr/src/wheels/psycopg2*.whl \
&& python3 -m pip list
WORKDIR /usr/src/paperless/src/
# Python dependencies
# Change pretty frequently
COPY requirements.txt ../
COPY Pipfile* ./
# Packages needed only for building a few quick Python
# dependencies
@@ -191,20 +193,30 @@ RUN set -eux \
&& apt-get update \
&& apt-get install --yes --quiet --no-install-recommends ${BUILD_PACKAGES} \
&& python3 -m pip install --no-cache-dir --upgrade wheel \
&& echo "Installing pipenv" \
&& python3 -m pip install --no-cache-dir --upgrade pipenv \
&& echo "Installing Python requirements" \
&& python3 -m pip install --default-timeout=1000 --no-cache-dir -r ../requirements.txt \
# pipenv tries to be too fancy and prints so much junk
&& pipenv requirements > requirements.txt \
&& python3 -m pip install --default-timeout=1000 --no-cache-dir --requirement requirements.txt \
&& rm requirements.txt \
&& echo "Cleaning up image" \
&& apt-get -y purge ${BUILD_PACKAGES} \
&& apt-get -y autoremove --purge \
&& apt-get clean --yes \
# Remove pipenv and its unique packages
&& python3 -m pip uninstall --yes \
pipenv \
distlib \
platformdirs \
virtualenv \
virtualenv-clone \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /tmp/* \
&& rm -rf /var/tmp/* \
&& rm -rf /var/cache/apt/archives/* \
&& truncate -s 0 /var/log/*log
WORKDIR /usr/src/paperless/src/
# copy backend
COPY ./src ./