diff --git a/Dockerfile b/Dockerfile index f07b65b9..1cfb0e5a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,9 @@ ARG PHP_VERSION=8.4 # --- # Build assets stage - runs on native platform (not emulated) # This stage builds the frontend assets (JavaScript, CSS) using Node.js and Yarn -FROM composer:latest AS composer-deps +# The --platform=$BUILDPLATFORM ensures this stage runs on the native build platform (amd64) +# and not under emulation for ARM builds +FROM --platform=$BUILDPLATFORM composer:latest AS composer-deps WORKDIR /build @@ -19,7 +21,7 @@ RUN composer install --no-dev --no-scripts --no-autoloader --prefer-dist --ignor # --- -FROM node:22-bookworm-slim AS assets +FROM --platform=$BUILDPLATFORM node:22-bookworm-slim AS assets WORKDIR /build diff --git a/Dockerfile-frankenphp b/Dockerfile-frankenphp index ba4b01db..0f523189 100644 --- a/Dockerfile-frankenphp +++ b/Dockerfile-frankenphp @@ -1,7 +1,9 @@ # --- # Build assets stage - runs on native platform (not emulated) # This stage builds the frontend assets (JavaScript, CSS) using Node.js and Yarn -FROM composer:latest AS composer-deps +# The --platform=$BUILDPLATFORM ensures this stage runs on the native build platform (amd64) +# and not under emulation for ARM builds +FROM --platform=$BUILDPLATFORM composer:latest AS composer-deps WORKDIR /build @@ -16,7 +18,7 @@ RUN composer install --no-dev --no-scripts --no-autoloader --prefer-dist --ignor # --- -FROM node:22-bookworm-slim AS assets +FROM --platform=$BUILDPLATFORM node:22-bookworm-slim AS assets WORKDIR /build