Build real translations in node-builder stage via cache warmup

Co-authored-by: jbtronics <5410681+jbtronics@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2026-02-15 16:12:40 +00:00
parent ac4e3a556f
commit f9517602bc
2 changed files with 18 additions and 12 deletions

View file

@ -35,12 +35,15 @@ 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
COPY <<EOF var/translations/index.js
export const messages = {};
export const localeFallbacks = {};
EOF
# Create required directories for cache warmup
RUN mkdir -p var/cache var/log uploads public/media
# Generate real translations via cache warmup (needed for webpack build)
RUN echo "yes" | php bin/console cache:warmup --env=prod || \
(echo "Warning: Cache warmup failed, but continuing..." && \
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 ./

View file

@ -33,12 +33,15 @@ 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
COPY <<EOF var/translations/index.js
export const messages = {};
export const localeFallbacks = {};
EOF
# Create required directories for cache warmup
RUN mkdir -p var/cache var/log uploads public/media
# Generate real translations via cache warmup (needed for webpack build)
RUN echo "yes" | php bin/console cache:warmup --env=prod || \
(echo "Warning: Cache warmup failed, but continuing..." && \
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 ./