mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-07-28 18:24:38 -05:00
Transitions the Docker image to use s6 and s6-overlay for process supervision instead of supervisord (#8886)
This commit is contained in:
24
docker/rootfs/etc/s6-overlay/s6-rc.d/svc-flower/run
Executable file
24
docker/rootfs/etc/s6-overlay/s6-rc.d/svc-flower/run
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/command/with-contenv /usr/bin/bash
|
||||
# shellcheck shell=bash
|
||||
|
||||
declare -r log_prefix="[svc-flower]"
|
||||
|
||||
echo "${log_prefix} Checking if we should start flower..."
|
||||
|
||||
if [[ -n "${PAPERLESS_ENABLE_FLOWER}" ]]; then
|
||||
# Small delay to allow celery to be up first
|
||||
echo "${log_prefix} Starting flower in 5s"
|
||||
sleep 5
|
||||
cd ${PAPERLESS_SRC_DIR}
|
||||
|
||||
if [[ -n "${USER_IS_NON_ROOT}" ]]; then
|
||||
exec /usr/local/bin/celery --app paperless flower --conf=${PAPERLESS_SRC_DIR}/paperless/flowerconfig.py
|
||||
else
|
||||
exec s6-setuidgid paperless /usr/local/bin/celery --app paperless flower --conf=${PAPERLESS_SRC_DIR}/paperless/flowerconfig.py
|
||||
fi
|
||||
|
||||
else
|
||||
echo "${log_prefix} Not starting flower"
|
||||
# https://skarnet.org/software/s6/s6-svc.html
|
||||
s6-svc -Od .
|
||||
fi
|
1
docker/rootfs/etc/s6-overlay/s6-rc.d/svc-flower/type
Normal file
1
docker/rootfs/etc/s6-overlay/s6-rc.d/svc-flower/type
Normal file
@@ -0,0 +1 @@
|
||||
longrun
|
Reference in New Issue
Block a user