Docker: Improve entrypoint.sh #543 #547

A group is now created if it doesn't exist already.

Signed-off-by: Michael Mayer <michael@lastzero.net>
This commit is contained in:
Michael Mayer 2020-10-13 22:45:27 +02:00
parent 2b0680a31e
commit 2e31120cda

View file

@ -5,11 +5,11 @@ if [[ ${UMASK} ]]; then
fi fi
if [[ ${UID} ]] && [[ ${GID} ]] && [[ ${UID} != "0" ]] && [[ $(id -u) = "0" ]]; then if [[ ${UID} ]] && [[ ${GID} ]] && [[ ${UID} != "0" ]] && [[ $(id -u) = "0" ]]; then
usermod -u ${UID} photoprism groupadd -f -g ${GID} ${GID}
usermod -g ${GID} photoprism usermod -o -u ${UID} -g ${GID} photoprism
gosu ${UID}:${GID} "$@" & gosu ${UID}:${GID} "$@" &
elif [[ ${UID} ]] && [[ ${UID} != "0" ]] && [[ $(id -u) = "0" ]]; then elif [[ ${UID} ]] && [[ ${UID} != "0" ]] && [[ $(id -u) = "0" ]]; then
usermod -u ${UID} photoprism usermod -o -u ${UID} photoprism
gosu ${UID} "$@" & gosu ${UID} "$@" &
else else
"$@" & "$@" &