Updated the build pipeline to use Node 22 + npm 11 and to skip dev dependencies during production builds.

This commit is contained in:
Codex Agent
2025-12-15 09:19:39 +01:00
parent a8b6e5d9c4
commit 763af12617
2 changed files with 6 additions and 5 deletions

View File

@@ -1,7 +1,7 @@
# syntax=docker/dockerfile:1.6 # syntax=docker/dockerfile:1.6
ARG PHP_VERSION=8.3 ARG PHP_VERSION=8.3
ARG NODE_VERSION=20 ARG NODE_VERSION=22
################################################################################ ################################################################################
# Composer dependencies # Composer dependencies
@@ -39,7 +39,8 @@ RUN apt-get update \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
COPY package.json package-lock.json ./ COPY package.json package-lock.json ./
RUN npm ci --no-audit --prefer-offline RUN npm install -g npm@11 \
&& npm ci --omit=dev --no-audit --prefer-offline
COPY . . COPY . .
COPY --from=vendor /var/www/html/vendor ./vendor COPY --from=vendor /var/www/html/vendor ./vendor

View File

@@ -30,7 +30,7 @@ x-app-build: &app-build
target: app target: app
args: args:
PHP_VERSION: ${PHP_VERSION:-8.3} PHP_VERSION: ${PHP_VERSION:-8.3}
NODE_VERSION: ${NODE_VERSION:-20} NODE_VERSION: ${NODE_VERSION:-22}
cache_from: cache_from:
- type=registry,ref=${APP_IMAGE_CACHE:-fotospiel-app:buildcache} - type=registry,ref=${APP_IMAGE_CACHE:-fotospiel-app:buildcache}
cache_to: cache_to:
@@ -74,12 +74,12 @@ services:
restart: unless-stopped restart: unless-stopped
docs-build: docs-build:
image: node:20 image: node:22
working_dir: /var/www/html/docs/site working_dir: /var/www/html/docs/site
command: command:
- bash - bash
- -lc - -lc
- npm ci && npm run build - npm install -g npm@11 && npm ci && npm run build
volumes: volumes:
- app-code:/var/www/html - app-code:/var/www/html
env_file: env_file: