mirror of
https://github.com/calibrain/shelfmark.git
synced 2026-09-24 20:00:27 +01:00
Soft fail for chown in entrypoint.sh (#97)
Co-authored-by: Daniel Egberts <daniel@MacBook-Pro-van-Daniel.local>
This commit is contained in:
+9
-2
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user