Fix frontend build by including Filament CSS in Docker
This commit is contained in:
29
Dockerfile
29
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; \
|
||||
|
||||
Reference in New Issue
Block a user