From b93bdd59aca50ea594b788b50ae01b27c84f52c1 Mon Sep 17 00:00:00 2001 From: Daniel <588394+qliratu@users.noreply.github.com> Date: Mon, 17 Mar 2025 19:47:53 +0100 Subject: [PATCH] Soft fail for chown in entrypoint.sh (#97) Co-authored-by: Daniel Egberts --- entrypoint.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 974e5be..a82b75b 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -24,7 +24,14 @@ fi USERNAME=$(getent passwd "$UID" | cut -d: -f1) # Ensure proper ownership of application directories -chown -R "${UID}:${GID}" /app /var/log/cwa-book-downloader /cwa-book-ingest +change_ownership() { + folder=$1 + chown -R "${UID}:${GID}" "${folder}" || echo "Failed to change ownership for ${folder}, continuing..." +} + +change_ownership /app +change_ownership /var/log/cwa-book-downloader +change_ownership /cwa-book-ingest # Switch to the user (either newly created or existing) and execute the main command -exec su -s /bin/bash "$USERNAME" -c "python -m app" \ No newline at end of file +exec su -s /bin/bash "$USERNAME" -c "python -m app"