Files
dokuwiki-docker/root/dokuwiki-entrypoint.sh
Andreas Gohr 5b861a073c add more info on user ID handling
The entrypoint will now print the UID and GID the container was started
at. This should help debugging issues like #8 and #13

Some comments were added to the compose file as well.
2024-08-19 09:04:32 +02:00

22 lines
659 B
Bash
Executable File

#!/bin/bash
set -x
set -e
echo "Started under UID $(id -u) GID $(id -g)."
# when the container runs as root, apache will drop privileges and run
# as www-data(33), we do the same for the storage setup
if [ "$EUID" -eq 0 ]; then
echo "Running as root, dropping privileges to 33:33"
# make sure we have access to the storage volume
chown -R www-data:www-data /storage
# drop privileges and run setup
setpriv --reuid=33 --regid=33 --init-groups /dokuwiki-storagesetup.sh
else
# we are already running as unprivileged user, just run setup
/dokuwiki-storagesetup.sh
fi
# run parent image's entrypoint
exec docker-php-entrypoint apache2-foreground