From 4d8a587d8b4c7a088188fad9819e998a58a0871f Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Wed, 16 Jul 2025 09:44:23 -0700 Subject: [PATCH] Update docker-entrypoint.sh --- docker-entrypoint.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 16ce33aa6..a30066d9a 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -17,13 +17,15 @@ if [ -e /app/config ]; then CURRENT_UID=$(stat -c %u /app/config) CURRENT_GID=$(stat -c %g /app/config) - if [ "$CURRENT_UID" -ne "$PUID" ] || [ "$CURRENT_GID" -ne "$PGID" ]; then - echo "Fixing ownership of /app/config" - if ! chown -R "$PUID:$PGID" /app/config 2>/dev/null; then - echo "Warning: Could not chown /app/config; continuing anyway" + if [ "$CURRENT_UID" -eq "$PUID" ] && [ "$CURRENT_GID" -eq "$PGID" ]; then + echo "/app/config already owned by correct UID/GID, skipping chown" + if ! [ -w /app/config ]; then + echo "Warning: /app/config is not writable by UID $PUID — this can happen with bind mounts" + echo "Hint: Run 'chmod -R u+rwX /path/to/config' on the host" fi else - echo "/app/config already owned by correct UID/GID, skipping chown" + echo "Fixing ownership of /app/config" + chown -R "$PUID:$PGID" /app/config 2>/dev/null || echo "Warning: Could not chown /app/config" fi else echo "/app/config does not exist; skipping ownership check"