paperless-ngx/Dockerfile

54 lines
1.3 KiB
Docker
Raw Normal View History

2023-08-30 16:24:33 +00:00
FROM docker.io/alpine:3.18 AS builder
RUN apk add --no-cache \
python3-dev \
make \
g++ \
musl-dev \
libpq-dev \
freetype-dev \
qpdf-dev
ENV VERSION=v1.17.2
ENV ARCHIVE=paperless-ngx-$VERSION.tar.xz
ENV SHA256_SUM=a4b47e4fc6ff2321a2f616fcfeec2740f1866c555fa5bc9d47da85e31e8c05dd
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
RUN sed 's/scipy==1.8.1/scipy==1.11.2/g' -i requirements.txt
RUN python3 -m venv env
RUN env/bin/pip3 install -r requirements.txt
FROM docker.io/thallian/alpine-s6:3.18-3.1.5.0
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 \
tesseract-ocr-data-eng
COPY --from=builder /install /var/lib/paperless
ADD /rootfs /
RUN chown -R paperless:paperless /var/lib/paperless
ENV HOME /var/lib/paperless
VOLUME ["/var/lib/paperless/media", "/var/lib/paperless/consume", "/var/lib/paperless/data"]
EXPOSE 8000