mirror of
https://github.com/dokuwiki/docker.git
synced 2025-07-23 02:54:48 +00:00

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.
22 lines
659 B
Bash
Executable File
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
|