From b47de6149492ce2c619ec1b3a3939117b584ec84 Mon Sep 17 00:00:00 2001 From: Pieter van der Meulen Date: Thu, 21 Sep 2023 14:36:42 +0200 Subject: [PATCH] Fix: the /var/cache/prod directory must be writable by the apache php module --- docker/Dockerfile.prod | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docker/Dockerfile.prod b/docker/Dockerfile.prod index 69b9ee2d9..209dd1b25 100644 --- a/docker/Dockerfile.prod +++ b/docker/Dockerfile.prod @@ -11,7 +11,12 @@ COPY config/packages/prod/monolog.yaml.docker config/packages/prod/monolog.yaml # Add the config files for Apache2 RUN rm -rf /etc/apache2/sites-enabled/* COPY ./docker/conf/middleware-apache2.conf /etc/apache2/sites-enabled/middleware.conf -RUN rm -rf /var/www/html/var/cache/prod && chown -R www-data /var/www/html/var + +# Recreate the cache directory and set the correct permissions +RUN rm -rf /var/www/html/var/cache/prod && \ + mkdir -p /var/www/html/var/cache/prod && \ + chown -R www-data /var/www/html/var + EXPOSE 80 # Set the default workdir