[**/test_*.py]
max_line_length = off
-[Dockerfile]
+[Dockerfile*]
indent_style = space
- id: yesqa
exclude: "(migrations)"
- repo: https://github.com/asottile/add-trailing-comma
- rev: "v2.2.2"
+ rev: "v2.2.3"
hooks:
- id: add-trailing-comma
exclude: "(migrations)"
- id: black
# Dockerfile hooks
- repo: https://github.com/AleksaC/hadolint-py
- rev: v1.19.0
+ rev: v2.10.0
hooks:
- id: hadolint
args:
- - --ignore
- - DL3006 # https://github.com/hadolint/hadolint/wiki/DL3006 (doesn't understand FROM with ARG)
- --ignore
- DL3008 # https://github.com/hadolint/hadolint/wiki/DL3008 (should probably do this at some point)
- --ignore
- DL3013 # https://github.com/hadolint/hadolint/wiki/DL3013 (should probably do this too at some point)
+ - --ignore
+ - DL3003 # https://github.com/hadolint/hadolint/wiki/DL3003 (seems excessive to use WORKDIR so much)
# Shell script hooks
- repo: https://github.com/lovesegfault/beautysh
rev: v6.2.1
WORKDIR /src/src-ui
RUN set -eux \
- && npm update npm -g \
- && npm ci --no-optional
+ && npm update npm -g \
+ && npm ci --no-optional
RUN set -eux \
- && ./node_modules/.bin/ng build --configuration production
+ && ./node_modules/.bin/ng build --configuration production
# This Dockerfile compiles the jbig2enc library
# Inputs:
-# - JBIG2ENC_VERSION - the Git tag to checkout and build
+# - JBIG2ENC_VERSION - the Git tag to checkout and build
FROM debian:bullseye-slim
ARG JBIG2ENC_VERSION
RUN set -eux \
- && git clone --quiet --branch $JBIG2ENC_VERSION https://github.com/agl/jbig2enc .
+ && git clone --quiet --branch $JBIG2ENC_VERSION https://github.com/agl/jbig2enc .
RUN set -eux \
- && ./autogen.sh
+ && ./autogen.sh
RUN set -eux \
- && ./configure && make
+ && ./configure && make
# This Dockerfile builds the pikepdf wheel
# Inputs:
-# - REPO - Docker repository to pull qpdf from
-# - QPDF_VERSION - The image qpdf version to copy .deb files from
-# - PIKEPDF_GIT_TAG - The Git tag to clone and build from
-# - PIKEPDF_VERSION - Used to force the built pikepdf version to match
+# - REPO - Docker repository to pull qpdf from
+# - QPDF_VERSION - The image qpdf version to copy .deb files from
+# - PIKEPDF_GIT_TAG - The Git tag to clone and build from
+# - PIKEPDF_VERSION - Used to force the built pikepdf version to match
# Default to pulling from the main repo registry when manually building
ARG REPO="paperless-ngx/paperless-ngx"
ARG PIKEPDF_VERSION
RUN set -eux \
- && echo "building pikepdf wheel" \
+ && echo "building pikepdf wheel" \
# Note the v in the tag name here
&& git clone --quiet --depth 1 --branch "${PIKEPDF_GIT_TAG}" https://github.com/pikepdf/pikepdf.git \
&& cd pikepdf \
# This Dockerfile builds the psycopg2 wheel
# Inputs:
-# - PSYCOPG2_GIT_TAG - The Git tag to clone and build from
-# - PSYCOPG2_VERSION - Unused, kept for future possible usage
+# - PSYCOPG2_GIT_TAG - The Git tag to clone and build from
+# - PSYCOPG2_VERSION - Unused, kept for future possible usage
FROM python:3.9-slim-bullseye
&& apt-get update --quiet \
&& apt-get install --yes --quiet --no-install-recommends $BUILD_PACKAGES \
&& rm -rf /var/lib/apt/lists/* \
- && python3 -m pip install --upgrade pip wheel
+ && python3 -m pip install --no-cache-dir --upgrade pip wheel
# Layers after this point change according to required version
# For better caching, seperate the basic installs from
ARG PSYCOPG2_VERSION
RUN set -eux \
- && echo "Building psycopg2 wheel" \
+ && echo "Building psycopg2 wheel" \
&& cd /usr/src \
&& git clone --quiet --depth 1 --branch ${PSYCOPG2_GIT_TAG} https://github.com/psycopg/psycopg2.git \
&& cd psycopg2 \
# In order to get the required version of qpdf, it is backported from bookwork
# and then built from source
RUN set -eux \
- && echo "Building qpdf" \
- && echo "deb-src http://deb.debian.org/debian/ bookworm main" | tee /etc/apt/sources.list.d/bookworm-src.list \
+ && echo "Building qpdf" \
+ && echo "deb-src http://deb.debian.org/debian/ bookworm main" > /etc/apt/sources.list.d/bookworm-src.list \
&& apt-get update \
&& mkdir qpdf \
&& cd qpdf \
&& apt-get source --yes --quiet qpdf=${QPDF_VERSION}-1/bookworm \
&& rm -rf /var/lib/apt/lists/* \
&& cd qpdf-$QPDF_VERSION \
+ # We don't need to build the tests (also don't run them)
+ && rm -rf libtests \
&& DEBEMAIL=hello@paperless-ngx.com debchange --bpo \
- && export DEB_BUILD_OPTIONS="terse nocheck nodoc parallel=2" \
+ && export DEB_BUILD_OPTIONS="terse nocheck nodoc parallel=2" \
&& dpkg-buildpackage --build=binary --unsigned-source --unsigned-changes \
- && pwd \
&& ls -ahl ../*.deb
FROM python:3.5.1
# Install Sphinx and Pygments
-RUN pip install Sphinx Pygments
+RUN pip install --no-cache-dir Sphinx Pygments \
+ # Setup directories, copy data
+ && mkdir /build
-# Setup directories, copy data
-RUN mkdir /build
COPY . /build
WORKDIR /build/docs