Dockerfile: Make sure the storage and cache directories exist and are writeable before running composer install
Build and Deploy / build (push) Failing after 1m29s

This commit is contained in:
Mischa Spelt
2026-08-24 11:11:04 +02:00
parent 4701c3f86d
commit 2aca0010dc
+7 -6
View File
@@ -48,12 +48,7 @@ COPY composer.json composer.lock ./
# Note: for Laravel, the COPY . . needs to be before the composer install # Note: for Laravel, the COPY . . needs to be before the composer install
COPY . . COPY . .
RUN composer install \ # Make sure the storage and cache directories exist and are writeable before running composer install
--no-dev \
--prefer-dist \
--no-interaction \
--optimize-autoloader
RUN mkdir -p \ RUN mkdir -p \
storage/app \ storage/app \
storage/framework/cache/data \ storage/framework/cache/data \
@@ -64,4 +59,10 @@ RUN mkdir -p \
&& chown -R www-data:www-data storage bootstrap/cache \ && chown -R www-data:www-data storage bootstrap/cache \
&& chmod -R ug+rwX storage bootstrap/cache && chmod -R ug+rwX storage bootstrap/cache
RUN composer install \
--no-dev \
--prefer-dist \
--no-interaction \
--optimize-autoloader
EXPOSE 80 EXPOSE 80