diff --git a/infra/dev/Dockerfile b/infra/dev/Dockerfile index 71b6c59..c5e8dd7 100644 --- a/infra/dev/Dockerfile +++ b/infra/dev/Dockerfile @@ -52,12 +52,19 @@ RUN apt-get update && apt-get install -y \ xsl -# Installation de node -RUN wget -qO- "https://nodejs.org/dist/v${DOCKER_NODE_VERSION}/node-v${DOCKER_NODE_VERSION}-linux-x64.tar.xz" | tar xJC /tmp/ && \ - cp -r /tmp/node-v${DOCKER_NODE_VERSION}-linux-x64/bin /usr/ && \ - cp -r /tmp/node-v${DOCKER_NODE_VERSION}-linux-x64/include /usr/ && \ - cp -r /tmp/node-v${DOCKER_NODE_VERSION}-linux-x64/lib /usr/ && \ - cp -r /tmp/node-v${DOCKER_NODE_VERSION}-linux-x64/share /usr/ && \ +# Installation de node — architecture detectee a la volee +# (x64 sur Intel/amd64, arm64 sur Apple Silicon) pour que le build passe sur les deux. +RUN NODE_ARCH="$(dpkg --print-architecture)" && \ + case "$NODE_ARCH" in \ + amd64) NODE_ARCH="x64" ;; \ + arm64) NODE_ARCH="arm64" ;; \ + *) echo "Architecture Node non supportee : $NODE_ARCH" && exit 1 ;; \ + esac && \ + wget -qO- "https://nodejs.org/dist/v${DOCKER_NODE_VERSION}/node-v${DOCKER_NODE_VERSION}-linux-${NODE_ARCH}.tar.xz" | tar xJC /tmp/ && \ + cp -r /tmp/node-v${DOCKER_NODE_VERSION}-linux-${NODE_ARCH}/bin /usr/ && \ + cp -r /tmp/node-v${DOCKER_NODE_VERSION}-linux-${NODE_ARCH}/include /usr/ && \ + cp -r /tmp/node-v${DOCKER_NODE_VERSION}-linux-${NODE_ARCH}/lib /usr/ && \ + cp -r /tmp/node-v${DOCKER_NODE_VERSION}-linux-${NODE_ARCH}/share /usr/ && \ npm install --global yarn # installation/activation d'extensions php diff --git a/makefile b/makefile index 67d070e..f274e0d 100644 --- a/makefile +++ b/makefile @@ -74,7 +74,7 @@ help: @printf "\n Plus de details : \033[4mREADME.md\033[0m, \033[4mCLAUDE.md\033[0m\n\n" env-init: - @cp --update=none $(ENV_DEFAULT) $(ENV_LOCAL) + @test -f $(ENV_LOCAL) || cp $(ENV_DEFAULT) $(ENV_LOCAL) # Lance le container start: env-init