mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-03-01 12:59:36 +00:00
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:
parent
ac4e3a556f
commit
f9517602bc
2 changed files with 18 additions and 12 deletions
15
Dockerfile
15
Dockerfile
|
|
@ -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 ./
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue