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
if [[ ${UID} ]] && [[ ${GID} ]] && [[ ${UID} != "0" ]] && [[ $(id -u) = "0" ]]; then
usermod -u ${UID} photoprism
usermod -g ${GID} photoprism
groupadd -f -g ${GID} ${GID}
usermod -o -u ${UID} -g ${GID} photoprism
gosu ${UID}:${GID} "$@" &
elif [[ ${UID} ]] && [[ ${UID} != "0" ]] && [[ $(id -u) = "0" ]]; then
usermod -u ${UID} photoprism
usermod -o -u ${UID} photoprism
gosu ${UID} "$@" &
else
"$@" &