Chown is ok for files on base image...

This commit is contained in:
ian351c 2024-06-05 12:36:38 -04:00 committed by GitHub
parent 78b3822c74
commit 8fbe585470
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -32,13 +32,17 @@ process_folder () {
echo "$(sed -E "$SED_REGEX" "$FILE")" > $FILE echo "$(sed -E "$SED_REGEX" "$FILE")" > $FILE
done done
if [ "$SKIP_FILE_OWNERSHIP" == "true" ] || [ "$SKIP_FILE_OWNERSHIP" == "on" ] || [ "$SKIP_FILE_OWNERSHIP" == "1" ] || [ "$SKIP_FILE_OWNERSHIP" == "yes" ]; then
log_info 'Skipping ownership, use only with caution ...'
else
# ensure the files are still owned by the npm user # ensure the files are still owned by the npm user
chown -R "$PUID:$PGID" "$1" chown -R "$PUID:$PGID" "$1"
fi fi
} }
# process files on base image
process_folder /etc/nginx/conf.d process_folder /etc/nginx/conf.d
process_folder /data/nginx # conditionally process files that are probably in a volume or bind
if [ "$SKIP_FILE_OWNERSHIP" == "true" ] || [ "$SKIP_FILE_OWNERSHIP" == "on" ] || [ "$SKIP_FILE_OWNERSHIP" == "1" ] || [ "$SKIP_FILE_OWNERSHIP" == "yes" ]; then
log_info 'Skipping ownership, use only with caution ...'
else
process_folder /data/nginx
fi