initial commit

This commit is contained in:
Sebastian Hugentobler 2023-08-30 18:24:33 +02:00
commit 996ba9de35
Signed by untrusted user who does not match committer: shu
GPG Key ID: BB32CF3CA052C2F0
24 changed files with 111 additions and 0 deletions

3
.gitignore vendored Executable file
View File

@ -0,0 +1,3 @@
*~
.DS_Store
*.swp

12
.woodpecker.yml Normal file
View File

@ -0,0 +1,12 @@
pipeline:
publish-docker-image:
image: plugins/kaniko
settings:
repo: docker.io/thallian/paperless-ngx
tags: latest,${CI_COMMIT_SHA:0:8},${CI_COMMIT_TAG=pre}
dockerfile: Dockerfile
username:
from_secret: DOCKER_USER
password:
from_secret: DOCKER_PW

53
Dockerfile Normal file
View File

@ -0,0 +1,53 @@
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

16
README.md Normal file
View File

@ -0,0 +1,16 @@
[paperless-ngx](https://github.com/paperless-ngx/paperless-ngx) document
management system.
# Volumes
- `/var/lib/paperless/media/`
- `/var/lib/paperless/consume/`
# Environment Variables
Refer to the [documentation](https://docs.paperless-ngx.com/configuration) for
possible configurations.
# Ports
- 8000

2
rootfs/bin/db-migration Executable file
View File

@ -0,0 +1,2 @@
#!/bin/sh
s6-setuidgid paperless ~/env/bin/python3 ~/src/manage.py migrate

View File

@ -0,0 +1 @@
db-migration

View File

@ -0,0 +1,3 @@
#!/bin/sh
s6-setuidgid paperless ~/env/bin/python3 ~/src/manage.py document_consumer

View File

@ -0,0 +1 @@
longrun

View File

@ -0,0 +1 @@
oneshot

View File

@ -0,0 +1 @@
db-migration

View File

@ -0,0 +1 @@
db-migration

View File

@ -0,0 +1,4 @@
#!/bin/sh
cd /var/lib/paperless/src || exit
s6-setuidgid paperless ~/env/bin/python3 ~/env/bin/celery --app paperless beat --loglevel INFO

View File

@ -0,0 +1 @@
longrun

View File

@ -0,0 +1 @@
db-migration

View File

@ -0,0 +1,4 @@
#!/bin/sh
cd /var/lib/paperless/src || exit
s6-setuidgid paperless ~/env/bin/python3 ~/env/bin/celery --app paperless worker --loglevel INFO

View File

@ -0,0 +1 @@
longrun

View File

@ -0,0 +1 @@
db-migration

View File

@ -0,0 +1,4 @@
#!/bin/sh
cd /var/lib/paperless/src || exit
s6-setuidgid paperless ~/env/bin/python3 ~/env/bin/gunicorn -c ~/gunicorn.conf.py paperless.asgi:application

View File

@ -0,0 +1 @@
longrun