Skip to content

Commit

Permalink
changed start up permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
Drazzilb08 committed Feb 5, 2024
1 parent 21a0ccb commit 02d85c0
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,22 @@ cp -Rn /app/config/* /config
# Change permissions of the /config directory to 777
chmod -R 777 /config

# Modify the user ID of the dockeruser
chown -R dockeruser:dockeruser /app /config

# Change ownership of the /app and /config directory to dockeruser
# Loop through all mounted volumes
for volume in $(find / -mount | cut -d' ' -f3); do
# Skip over read-only volumes
if mount | grep -F "$volume" | grep -q "(ro,"; then
echo "Skipping read-only volume: $volume"
continue
fi
if [[ "$volume" =~ ^/(root|home|etc|var|boot|usr|mnt|lib|bin|sbin|lib64|proc|sys|dev|run|tmp|media|srv|opt|snap|app) ]]; then
continue
fi
echo "Changing ownership of $volume to $PUID:$PGID"
# Change ownership recursively
chown -R $PUID:$PGID "$volume"
done

chown -R $PUID:$PGID /app

# Run the command as the dockeruser
exec runuser -u dockeruser -g dockeruser -- "$@"

0 comments on commit 02d85c0

Please sign in to comment.