From a7adc8c5e933284e77ccc79994c7b13600b708d4 Mon Sep 17 00:00:00 2001 From: Andrew Welch Date: Sun, 23 May 2021 15:53:45 -0400 Subject: [PATCH] Run container as www-data to avoid permmissions issues --- docker-config/php-dev-craft/Dockerfile | 3 +++ docker-config/php-prod-craft/Dockerfile | 3 +++ 2 files changed, 6 insertions(+) diff --git a/docker-config/php-dev-craft/Dockerfile b/docker-config/php-dev-craft/Dockerfile index d4efb7a..6d390c7 100755 --- a/docker-config/php-dev-craft/Dockerfile +++ b/docker-config/php-dev-craft/Dockerfile @@ -55,3 +55,6 @@ RUN mkdir -p /var/www/project/cms/web/cpresources && \ chown -R www-data:www-data /var/www/project/cms/web/cpresources WORKDIR /var/www/project/cms + +# run container as the www-data user +USER www-data diff --git a/docker-config/php-prod-craft/Dockerfile b/docker-config/php-prod-craft/Dockerfile index 4739338..501715a 100755 --- a/docker-config/php-prod-craft/Dockerfile +++ b/docker-config/php-prod-craft/Dockerfile @@ -62,6 +62,9 @@ RUN chown -R www-data:www-data /var/www/project/cms/web WORKDIR /var/www/project/cms +# run container as the www-data user +USER www-data + # Force permissions, update Craft, and start php-fpm # Do a `composer install` without running any Composer scripts