Remplace supervisord with caretakerd
This commit is contained in:
parent
5332e9c0fd
commit
76662fded8
|
@ -43,6 +43,8 @@ RUN set -euxo pipefail &&\
|
|||
FROM python:3.11-alpine
|
||||
MAINTAINER [[ .docker.maintainer ]]
|
||||
|
||||
ARG CARETAKERD_VERSION=1.0.8
|
||||
|
||||
ENV LANG=[[ .locale.lang ]] \
|
||||
TZ=[[ .locale.tz ]] \
|
||||
PAPERLESS_MODE=all-in-one \
|
||||
|
@ -85,6 +87,7 @@ COPY --from=builder /usr/share/nltk_data /usr/share/nltk_data
|
|||
RUN set -euxo pipefail &&\
|
||||
apk --no-cache add \
|
||||
tini \
|
||||
curl \
|
||||
unpaper \
|
||||
font-liberation \
|
||||
tesseract-ocr \
|
||||
|
@ -105,8 +108,10 @@ RUN set -euxo pipefail &&\
|
|||
pngquant \
|
||||
zlib \
|
||||
openblas \
|
||||
supervisor \
|
||||
&&\
|
||||
curl -sSL https://github.com/echocat/caretakerd/releases/download/v${CARETAKERD_VERSION}/caretakerd-linux-amd64.tar.gz | \
|
||||
tar xvz --exclude caretakerd.html -C /usr/local/bin &&\
|
||||
chmod +x /usr/local/bin/caretakerd &&\
|
||||
addgroup --gid 8994 paperless &&\
|
||||
adduser --system --ingroup paperless --disabled-password --uid 8994 --home /opt/paperless --shell /sbin/nologin paperless &&\
|
||||
mkdir -p /data /input &&\
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
services:
|
||||
webserver:
|
||||
type: master
|
||||
command: ["/opt/paperless/venv/bin/gunicorn", "-c", "/opt/paperless/gunicorn.conf.py", "--bind", "${PAPERLESS_BIND_ADDR}:${PAPERLESS_PORT}", "paperless.asgi:application"]
|
||||
consumer:
|
||||
command: ["/opt/paperless/venv/bin/python3", "manage.py", "document_consumer"]
|
||||
scheduler:
|
||||
command: ["/opt/paperless/venv/bin/celery", "--app", "paperless", "beat", "--loglevel", "INFO"]
|
||||
task-queue:
|
||||
command: ["/opt/paperless/venv/bin/celery", "--app", "paperless", "worker", "--loglevel", "INFO"]
|
|
@ -1,50 +0,0 @@
|
|||
[supervisord]
|
||||
pidfile=/tmp/supervisord.pi
|
||||
nodaemon=true
|
||||
logfile=/dev/stdout
|
||||
logfile_maxbytes=0
|
||||
|
||||
[program:webserver]
|
||||
command=/opt/paperless/venv/bin/gunicorn -c /opt/paperless/gunicorn.conf.py --bind=%(ENV_PAPERLESS_BIND_ADDR)s:%(ENV_PAPERLESS_PORT)s paperless.asgi:application
|
||||
stdout_logfile=/proc/self/fd/1
|
||||
stdout_logfile_backups=0
|
||||
stdout_logfile_maxbytes=0
|
||||
stderr_logfile=/proc/self/fd/2
|
||||
stderr_logfile_backups=0
|
||||
stderr_logfile_maxbytes=0
|
||||
autostart=true
|
||||
autorestart=true
|
||||
|
||||
[program:consumer]
|
||||
command=/opt/paperless/venv/bin/python3 manage.py document_consumer
|
||||
stdout_logfile=/proc/self/fd/1
|
||||
stdout_logfile_backups=0
|
||||
stdout_logfile_maxbytes=0
|
||||
stderr_logfile=/proc/self/fd/2
|
||||
stderr_logfile_backups=0
|
||||
stderr_logfile_maxbytes=0
|
||||
autostart=true
|
||||
autorestart=true
|
||||
|
||||
[program:scheduler]
|
||||
command=/opt/paperless/venv/bin/celery --app paperless beat --loglevel INFO
|
||||
stdout_logfile=/proc/self/fd/1
|
||||
stdout_logfile_backups=0
|
||||
stdout_logfile_maxbytes=0
|
||||
stderr_logfile=/proc/self/fd/2
|
||||
stderr_logfile_backups=0
|
||||
stderr_logfile_maxbytes=0
|
||||
autostart=true
|
||||
autorestart=true
|
||||
|
||||
[program:task-queue]
|
||||
command=/opt/paperless/venv/bin/celery --app paperless worker --loglevel INFO
|
||||
stdout_logfile=/proc/self/fd/1
|
||||
stdout_logfile_backups=0
|
||||
stdout_logfile_maxbytes=0
|
||||
stderr_logfile=/proc/self/fd/2
|
||||
stderr_logfile_backups=0
|
||||
stderr_logfile_maxbytes=0
|
||||
autostart=true
|
||||
autorestart=true
|
||||
|
|
@ -7,7 +7,7 @@ source /opt/paperless/venv/bin/activate
|
|||
cd /opt/paperless/src
|
||||
|
||||
if [ "${PAPERLESS_MODE}" = "all-in-one" ]; then
|
||||
exec supervisor -c /etc/supervisord.conf -n
|
||||
exec caretakerd run
|
||||
elif [ "${PAPERLESS_MODE}" = "webserver" ]; then
|
||||
exec /opt/paperless/venv/bin/gunicorn \
|
||||
-c /opt/paperless/gunicorn.conf.py \
|
||||
|
|
|
@ -34,7 +34,7 @@ paperless:
|
|||
webserver:
|
||||
|
||||
# The Docker image to use
|
||||
image: 'danielberteaud/paperless-ngx:2.2.1-1'
|
||||
image: '[[ .docker.repo ]]paperless-ngx:2.2.1-2'
|
||||
|
||||
# Env vars to set in the container
|
||||
env: {}
|
||||
|
|
Loading…
Reference in New Issue