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:
19
docker/rootfs/etc/s6-overlay/s6-rc.d/init-start/run
Executable file
19
docker/rootfs/etc/s6-overlay/s6-rc.d/init-start/run
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/command/with-contenv /usr/bin/bash
|
||||
# shellcheck shell=bash
|
||||
|
||||
declare -r log_prefix="[init-start]"
|
||||
|
||||
echo "${log_prefix} paperless-ngx docker container starting..."
|
||||
|
||||
# Set some directories into environment for other steps to access via environment
|
||||
# Sort of like variables for later
|
||||
printf "/usr/src/paperless/src" > /var/run/s6/container_environment/PAPERLESS_SRC_DIR
|
||||
echo $(date +%s) > /var/run/s6/container_environment/PAPERLESS_START_TIME_S
|
||||
|
||||
# Check if we're starting as a non-root user
|
||||
if [ $(id -u) == $(id -u paperless) ]; then
|
||||
printf "true" > /var/run/s6/container_environment/USER_IS_NON_ROOT
|
||||
echo "${log_prefix} paperless-ngx docker container running under a user"
|
||||
else
|
||||
echo "${log_prefix} paperless-ngx docker container starting init as root"
|
||||
fi
|
Reference in New Issue
Block a user