From 4b77a07b1a1afcf85c2989f1719792d841d93d56 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 15 Feb 2026 15:45:43 +0000 Subject: [PATCH] Fix node-builder stage with stub translations file Co-authored-by: jbtronics <5410681+jbtronics@users.noreply.github.com> --- Dockerfile | 37 +++++++++++++++++++++++-------------- Dockerfile-frankenphp | 37 +++++++++++++++++++++++-------------- 2 files changed, 46 insertions(+), 28 deletions(-) diff --git a/Dockerfile b/Dockerfile index 91dc8698..49dc40bc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,10 +7,9 @@ FROM node:${NODE_VERSION}-bookworm-slim AS node-builder WORKDIR /app -# Install composer - needed for symfony UX packages +# Install composer and minimal PHP for running Symfony commands COPY --from=composer:latest /usr/bin/composer /usr/bin/composer -# Install minimal PHP for composer (only for installing dependencies) RUN apt-get update && apt-get install -y --no-install-recommends \ php-cli \ php-xml \ @@ -19,21 +18,31 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ git \ && apt-get clean && rm -rf /var/lib/apt/lists/* -# Copy composer files and install PHP dependencies (needed for Symfony UX assets) +# Copy composer files and install dependencies (needed for Symfony UX assets) COPY composer.json composer.lock symfony.lock ./ -RUN composer install --no-scripts --no-autoloader --no-dev --prefer-dist +RUN composer install --no-scripts --no-autoloader --no-dev --prefer-dist --ignore-platform-reqs -# Copy package files for better layer caching -COPY package.json yarn.lock ./ - -# Install node dependencies -RUN yarn install --network-timeout 600000 - -# Copy necessary files for the build -COPY webpack.config.js ./ -COPY assets ./assets -COPY public ./public +# Copy all application files needed for cache warmup and webpack build +COPY .env* ./ +COPY bin ./bin +COPY config ./config +COPY src ./src COPY translations ./translations +COPY public ./public +COPY assets ./assets +COPY webpack.config.js ./ + +# Generate autoloader +RUN composer dump-autoload + +# Create stub translations file for webpack build (real translations will be generated in final image) +RUN mkdir -p var/translations && \ + echo 'export const messages = {};' > var/translations/index.js && \ + echo 'export const localeFallbacks = {};' >> var/translations/index.js + +# Copy package files and install node dependencies +COPY package.json yarn.lock ./ +RUN yarn install --network-timeout 600000 # Build the assets RUN yarn build diff --git a/Dockerfile-frankenphp b/Dockerfile-frankenphp index c3fccf40..149cffea 100644 --- a/Dockerfile-frankenphp +++ b/Dockerfile-frankenphp @@ -5,10 +5,9 @@ FROM node:${NODE_VERSION}-bookworm-slim AS node-builder WORKDIR /app -# Install composer - needed for symfony UX packages +# Install composer and minimal PHP for running Symfony commands COPY --from=composer:latest /usr/bin/composer /usr/bin/composer -# Install minimal PHP for composer (only for installing dependencies) RUN apt-get update && apt-get install -y --no-install-recommends \ php-cli \ php-xml \ @@ -17,21 +16,31 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ git \ && apt-get clean && rm -rf /var/lib/apt/lists/* -# Copy composer files and install PHP dependencies (needed for Symfony UX assets) +# Copy composer files and install dependencies (needed for Symfony UX assets) COPY composer.json composer.lock symfony.lock ./ -RUN composer install --no-scripts --no-autoloader --no-dev --prefer-dist +RUN composer install --no-scripts --no-autoloader --no-dev --prefer-dist --ignore-platform-reqs -# Copy package files for better layer caching -COPY package.json yarn.lock ./ - -# Install node dependencies -RUN yarn install --network-timeout 600000 - -# Copy necessary files for the build -COPY webpack.config.js ./ -COPY assets ./assets -COPY public ./public +# Copy all application files needed for cache warmup and webpack build +COPY .env* ./ +COPY bin ./bin +COPY config ./config +COPY src ./src COPY translations ./translations +COPY public ./public +COPY assets ./assets +COPY webpack.config.js ./ + +# Generate autoloader +RUN composer dump-autoload + +# Create stub translations file for webpack build (real translations will be generated in final image) +RUN mkdir -p var/translations && \ + echo 'export const messages = {};' > var/translations/index.js && \ + echo 'export const localeFallbacks = {};' >> var/translations/index.js + +# Copy package files and install node dependencies +COPY package.json yarn.lock ./ +RUN yarn install --network-timeout 600000 # Build the assets RUN yarn build