From 30c7d35c5d87b470c8b2c2242f0be4e798ed2d02 Mon Sep 17 00:00:00 2001 From: soeren Date: Thu, 29 Jan 2026 13:30:32 +0100 Subject: [PATCH] Fix frontend build by including Filament CSS in Docker --- Dockerfile | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4473d79..0ec1e02 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,18 +1,6 @@ # syntax=docker/dockerfile:1 -FROM node:20-alpine AS frontend_build - -WORKDIR /var/www/html - -COPY package*.json ./ -RUN npm ci --ignore-scripts - -COPY resources resources -COPY postcss.config.js tailwind.config.js vite.config.mjs jsconfig.json ./ - -RUN npm run build - -FROM php:8.3-fpm-alpine AS php_build +FROM php:8.3-fpm-alpine AS php_deps ENV COMPOSER_ALLOW_SUPERUSER=1 @@ -60,6 +48,21 @@ COPY . . RUN set -eux; \ composer install --no-dev --prefer-dist --optimize-autoloader --no-interaction --no-progress --no-scripts +FROM node:20-alpine AS frontend_build + +WORKDIR /var/www/html + +COPY package*.json ./ +RUN npm ci --ignore-scripts + +COPY resources resources +COPY postcss.config.js tailwind.config.js vite.config.mjs jsconfig.json ./ +COPY --from=php_deps /var/www/html/vendor/filament/filament/resources/css/theme.css /var/www/html/vendor/filament/filament/resources/css/theme.css + +RUN npm run build + +FROM php_deps AS php_build + COPY --from=frontend_build /var/www/html/public/build /var/www/html/public/build RUN set -eux; \