mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-03-04 06:19:36 +00:00
Fix node-builder stage with stub translations file
Co-authored-by: jbtronics <5410681+jbtronics@users.noreply.github.com>
This commit is contained in:
parent
6876fd9b43
commit
4b77a07b1a
2 changed files with 46 additions and 28 deletions
37
Dockerfile
37
Dockerfile
|
|
@ -7,10 +7,9 @@ FROM node:${NODE_VERSION}-bookworm-slim AS node-builder
|
||||||
|
|
||||||
WORKDIR /app
|
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
|
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 \
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
php-cli \
|
php-cli \
|
||||||
php-xml \
|
php-xml \
|
||||||
|
|
@ -19,21 +18,31 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
git \
|
git \
|
||||||
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
&& 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 ./
|
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 all application files needed for cache warmup and webpack build
|
||||||
COPY package.json yarn.lock ./
|
COPY .env* ./
|
||||||
|
COPY bin ./bin
|
||||||
# Install node dependencies
|
COPY config ./config
|
||||||
RUN yarn install --network-timeout 600000
|
COPY src ./src
|
||||||
|
|
||||||
# Copy necessary files for the build
|
|
||||||
COPY webpack.config.js ./
|
|
||||||
COPY assets ./assets
|
|
||||||
COPY public ./public
|
|
||||||
COPY translations ./translations
|
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
|
# Build the assets
|
||||||
RUN yarn build
|
RUN yarn build
|
||||||
|
|
|
||||||
|
|
@ -5,10 +5,9 @@ FROM node:${NODE_VERSION}-bookworm-slim AS node-builder
|
||||||
|
|
||||||
WORKDIR /app
|
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
|
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 \
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
php-cli \
|
php-cli \
|
||||||
php-xml \
|
php-xml \
|
||||||
|
|
@ -17,21 +16,31 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
git \
|
git \
|
||||||
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
&& 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 ./
|
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 all application files needed for cache warmup and webpack build
|
||||||
COPY package.json yarn.lock ./
|
COPY .env* ./
|
||||||
|
COPY bin ./bin
|
||||||
# Install node dependencies
|
COPY config ./config
|
||||||
RUN yarn install --network-timeout 600000
|
COPY src ./src
|
||||||
|
|
||||||
# Copy necessary files for the build
|
|
||||||
COPY webpack.config.js ./
|
|
||||||
COPY assets ./assets
|
|
||||||
COPY public ./public
|
|
||||||
COPY translations ./translations
|
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
|
# Build the assets
|
||||||
RUN yarn build
|
RUN yarn build
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue