From bb659ee27ab2fd4c90c801151603defc4da7211a Mon Sep 17 00:00:00 2001 From: Carey Metcalfe Date: Fri, 8 Aug 2025 07:36:57 -0400 Subject: Optimize how much data needs to be `chown`/`chmod`ed on container startup (#7793) * Optimize how much data needs to be `chown`/`chmod`ed on container startup This works around an issue where `chmod`/`chown` operations inside a container can be extremely slow when using the `overlay2` storage driver, resulting in 10min+ container startup times. It modifies the owner of the webapp when building the container so that only the `data` and `extensions` directories (which are commonly mapped as volumes into the container) have to be modified by the `access-permissions.sh` script at container startup. When not running via docker the behaviour of the `access-permissions.sh` script is unchanged. * Take DATA_PATH environment variable into account when fixing permissions * Revert change to using bash for arrays (the alpine image doesn't include `bash`) * A few more improvements * Slightly tweak reapply permissions variable - lowercase to indicate it's not an env variable - use 0/1 to address potentially-irrational paranoia about unset variables * Remove conditional logic to skip reapplying permissions Also documents why in a comment so it's not missed in the future. --------- Co-authored-by: Alexandre Alapetite --- Docker/Dockerfile-Oldest | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Docker/Dockerfile-Oldest') diff --git a/Docker/Dockerfile-Oldest b/Docker/Dockerfile-Oldest index 38fbadede..e31c75f20 100644 --- a/Docker/Dockerfile-Oldest +++ b/Docker/Dockerfile-Oldest @@ -13,7 +13,7 @@ RUN apk add --no-cache \ RUN mkdir -p /var/www/FreshRSS /run/apache2/ WORKDIR /var/www/FreshRSS -COPY . /var/www/FreshRSS +COPY --chown=root:www-data . /var/www/FreshRSS COPY ./Docker/*.Apache.conf /etc/apache2/conf.d/ ARG FRESHRSS_VERSION -- cgit v1.2.3