mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-05-23 17:02:55 -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() {
|
||||
# If container is started as root then create a new user and switch to it
|
||||
if [ "$(id -u)" = "0" ]; then
|
||||
if [ "$(id -u)" = $PUID ]; 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
|
||||
chown -R $PUID:$PGID /app
|
||||
|
||||
echo "Switching to dedicated user"
|
||||
exec gosu $PUID "$BASH_SOURCE" "$@"
|
||||
elif [ "$(id -u)" = $PUID ]; then
|
||||
echo "
|
||||
User uid: $PUID
|
||||
User gid: $PGID
|
||||
"
|
||||
fi
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user