Soft fail for chown in entrypoint.sh (#97)

Co-authored-by: Daniel Egberts <daniel@MacBook-Pro-van-Daniel.local>
This commit is contained in:
Daniel
2025-03-17 14:47:53 -04:00
committed by GitHub
co-authored by Daniel Egberts
parent 392a8b5262
commit b93bdd59ac
+9 -2
View File
@@ -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"
exec su -s /bin/bash "$USERNAME" -c "python -m app"