paperless-ngx/Containerfile

71 lines
1.7 KiB
Plaintext
Raw Permalink Normal View History

2023-12-21 08:59:53 +00:00
FROM docker.io/alpine:3.19 AS builder
2023-08-30 16:24:33 +00:00
RUN apk add --no-cache \
python3-dev \
make \
g++ \
musl-dev \
libpq-dev \
freetype-dev \
2023-12-21 08:59:53 +00:00
qpdf-dev \
gfortran \
cmake \
openblas-dev \
2023-12-21 13:47:29 +00:00
libffi-dev \
2023-12-21 08:59:53 +00:00
linux-headers
2023-08-30 16:24:33 +00:00
2024-03-28 13:51:33 +00:00
ENV VERSION=v2.6.3
2023-08-30 16:24:33 +00:00
ENV ARCHIVE=paperless-ngx-$VERSION.tar.xz
2024-03-28 13:51:33 +00:00
ENV SHA256_SUM=0c74c7d6ba35b576c47481021322d7f5e8847f89c489eed47f5399588aad6d19
2023-08-30 16:24:33 +00:00
RUN wget https://github.com/paperless-ngx/paperless-ngx/releases/download/$VERSION/$ARCHIVE
RUN echo "$SHA256_SUM $ARCHIVE" | sha256sum -c - || exit 1
RUN mkdir -p /install
RUN tar xf $ARCHIVE -C /install --strip 1
WORKDIR /install
RUN sed '/mysqlclient/d' -i requirements.txt
2023-12-21 08:59:53 +00:00
# RUN sed 's/scipy==1.8.1/scipy==1.11.2/g' -i requirements.txt
2023-08-30 17:59:23 +00:00
RUN sed 's/\(\["file_paperless\|\["file_mail\|\["file_celery\)/\["console/g' -i src/paperless/settings.py
RUN sed '/os\.makedirs(LOGGING_DIR, exist_ok=True)/d' -i src/paperless/settings.py
2023-08-30 16:24:33 +00:00
RUN python3 -m venv env
RUN env/bin/pip3 install -r requirements.txt
2023-12-21 08:59:53 +00:00
FROM docker.io/thallian/alpine-s6:3.19-3.1.6.2
2023-08-30 16:24:33 +00:00
RUN addgroup -g 2222 paperless
RUN adduser -h /var/lib/paperless -u 2222 -D -G paperless paperless
RUN apk add --no-cache \
python3 \
libpq \
freetype \
qpdf \
imagemagick \
ghostscript \
libmagic \
gpg \
tesseract-ocr \
tesseract-ocr-data-deu \
2023-08-31 07:13:19 +00:00
tesseract-ocr-data-eng \
2023-08-31 08:20:47 +00:00
tesseract-ocr-data-osd \
2023-08-31 07:13:19 +00:00
unpaper \
2023-08-31 08:20:47 +00:00
font-liberation \
poppler-utils
2023-08-30 16:24:33 +00:00
COPY --from=builder /install /var/lib/paperless
ADD /rootfs /
2023-08-31 05:35:49 +00:00
RUN mkdir /var/lib/paperless/consume
RUN mkdir /var/lib/paperless/data
2023-08-31 06:07:39 +00:00
RUN mkdir /var/lib/paperless/media
2023-08-31 05:35:49 +00:00
2023-08-30 16:24:33 +00:00
RUN chown -R paperless:paperless /var/lib/paperless
ENV HOME /var/lib/paperless
2023-08-31 07:13:19 +00:00
ENV S6_CMD_WAIT_FOR_SERVICES_MAXTIME=20000
2023-08-30 16:24:33 +00:00
VOLUME ["/var/lib/paperless/media", "/var/lib/paperless/consume", "/var/lib/paperless/data"]
EXPOSE 8000