mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-02 13:45:10 -05:00
Do granian running differently
This commit is contained in:
parent
f4413e0a08
commit
037389fbd5
@ -79,7 +79,7 @@ RUN set -eux \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Copy our service defs and filesystem
|
||||
COPY ./docker/rootfs /
|
||||
COPY --link ./docker/rootfs /
|
||||
|
||||
# Stage: main-app
|
||||
# Purpose: The final image
|
||||
@ -190,12 +190,7 @@ RUN set -eux \
|
||||
&& rm --force --verbose *.deb \
|
||||
&& rm --recursive --force --verbose /var/lib/apt/lists/*
|
||||
|
||||
# Copy webserver config
|
||||
# Changes very infrequently
|
||||
WORKDIR /usr/src/paperless/
|
||||
COPY --chown=1000:1000 webserver.py /usr/src/paperless/webserver.py
|
||||
|
||||
WORKDIR /usr/src/paperless/src/
|
||||
|
||||
# Python dependencies
|
||||
# Change pretty frequently
|
||||
|
@ -3,8 +3,18 @@
|
||||
|
||||
cd ${PAPERLESS_SRC_DIR}
|
||||
|
||||
if [[ -n "${USER_IS_NON_ROOT}" ]]; then
|
||||
exec python3 /usr/src/paperless/webserver.py
|
||||
else
|
||||
exec s6-setuidgid paperless python3 /usr/src/paperless/webserver.py
|
||||
# Translate between things, preferring GRANIAN_
|
||||
export GRANIAN_HOST=${GRANIAN_HOST:-${PAPERLESS_BIND_ADDR:-"::"}}
|
||||
export GRANIAN_PORT=${GRANIAN_PORT:-${PAPERLESS_PORT:-8000}}
|
||||
export GRANIAN_WORKERS=${GRANIAN_WORKERS:-${PAPERLESS_WEBSERVER_WORKERS:-1}}
|
||||
|
||||
# Only set GRANIAN_URL_PATH_PREFIX if PAPERLESS_FORCE_SCRIPT_NAME is set
|
||||
if [[ -n "${PAPERLESS_FORCE_SCRIPT_NAME}" ]]; then
|
||||
export GRANIAN_URL_PATH_PREFIX=${PAPERLESS_FORCE_SCRIPT_NAME}
|
||||
fi
|
||||
|
||||
if [[ -n "${USER_IS_NON_ROOT}" ]]; then
|
||||
exec granian --interface asginl --ws "paperless.asgi:application"
|
||||
else
|
||||
exec s6-setuidgid paperless granian --interface asginl --ws "paperless.asgi:application"
|
||||
fi
|
||||
|
Loading…
x
Reference in New Issue
Block a user