mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-05-24 01:12:54 -04:00
fix: running the container with PUID=0 and PGID=0 (#3030)
Co-authored-by: Hayden <64056131+hay-kot@users.noreply.github.com>
This commit is contained in:
parent
20621a1950
commit
4d49e307e3
@ -12,18 +12,18 @@ add_user() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
change_user() {
|
change_user() {
|
||||||
# If container is started as root then create a new user and switch to it
|
if [ "$(id -u)" = $PUID ]; then
|
||||||
if [ "$(id -u)" = "0" ]; then
|
echo "
|
||||||
|
User uid: $PUID
|
||||||
|
User gid: $PGID
|
||||||
|
"
|
||||||
|
elif [ "$(id -u)" = "0" ]; then
|
||||||
|
# If container is started as root then create a new user and switch to it
|
||||||
add_user
|
add_user
|
||||||
chown -R $PUID:$PGID /app
|
chown -R $PUID:$PGID /app
|
||||||
|
|
||||||
echo "Switching to dedicated user"
|
echo "Switching to dedicated user"
|
||||||
exec gosu $PUID "$BASH_SOURCE" "$@"
|
exec gosu $PUID "$BASH_SOURCE" "$@"
|
||||||
elif [ "$(id -u)" = $PUID ]; then
|
|
||||||
echo "
|
|
||||||
User uid: $PUID
|
|
||||||
User gid: $PGID
|
|
||||||
"
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user