From f143ec8516623a3e75b592b31ee60fa4e7a072bf Mon Sep 17 00:00:00 2001 From: Boy132 Date: Tue, 7 Jan 2025 08:34:24 +0100 Subject: [PATCH 1/3] fix docker build after vite update --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 3e2da64825..7a7abb1d18 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,7 +9,7 @@ COPY . ./ RUN yarn config set network-timeout 300000 \ && yarn install --frozen-lockfile \ - && yarn run build:production + && yarn run build FROM php:8.3-fpm-alpine # FROM --platform=$TARGETOS/$TARGETARCH php:8.3-fpm-alpine From d50906cee69e4a00810e7514852237be7b85daab Mon Sep 17 00:00:00 2001 From: Boy132 Date: Tue, 7 Jan 2025 10:36:21 +0100 Subject: [PATCH 2/3] build after composer install --- Dockerfile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7a7abb1d18..b090dad04a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,8 +8,7 @@ WORKDIR /build COPY . ./ RUN yarn config set network-timeout 300000 \ - && yarn install --frozen-lockfile \ - && yarn run build + && yarn install --frozen-lockfile FROM php:8.3-fpm-alpine # FROM --platform=$TARGETOS/$TARGETARCH php:8.3-fpm-alpine @@ -37,6 +36,12 @@ RUN touch .env RUN composer install --no-dev --optimize-autoloader +WORKDIR /build + +RUN yarn run build + +WORKDIR /var/www/html + # Set file permissions RUN chmod -R 755 storage bootstrap/cache \ && chown -R www-data:www-data ./ From f5b9bb9c9949622f00907bbacdab66c2dc02a72a Mon Sep 17 00:00:00 2001 From: Boy132 Date: Tue, 7 Jan 2025 10:38:33 +0100 Subject: [PATCH 3/3] move copy --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index b090dad04a..5afc4cd854 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,8 +30,6 @@ COPY Caddyfile /etc/caddy/Caddyfile # Copy the application code to the container COPY . . -COPY --from=yarn /build/public/assets ./public/assets - RUN touch .env RUN composer install --no-dev --optimize-autoloader @@ -42,6 +40,8 @@ RUN yarn run build WORKDIR /var/www/html +COPY --from=yarn /build/public/assets ./public/assets + # Set file permissions RUN chmod -R 755 storage bootstrap/cache \ && chown -R www-data:www-data ./