From f3108d4d8468c8d15330ffabfdb67911e32d433c Mon Sep 17 00:00:00 2001 From: syoul Date: Wed, 3 Dec 2025 15:48:17 +0100 Subject: [PATCH] =?UTF-8?q?fix:=20s=C3=A9parer=20les=20commandes=20RUN=20p?= =?UTF-8?q?our=20faciliter=20le=20d=C3=A9bogage=20du=20build=20Docker?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Séparation de la commande RUN complexe en plusieurs RUN distincts - Cela permet d'identifier plus facilement quelle étape échoue - Suppression du patch next.config.js qui n'est plus nécessaire en mode production --- Dockerfile.business | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Dockerfile.business b/Dockerfile.business index bf7938c..a84c11e 100644 --- a/Dockerfile.business +++ b/Dockerfile.business @@ -26,11 +26,10 @@ COPY . . RUN chmod +x scripts/start-business.sh # Préparer .techradar une fois pour toutes (évite les réinstallations au runtime) -RUN npx techradar install && \ - node -e "const fs=require('fs');const p='.techradar/package.json';const pkg=JSON.parse(fs.readFileSync(p,'utf8'));pkg.scripts=pkg.scripts||{};pkg.scripts.prepare='';fs.writeFileSync(p,JSON.stringify(pkg,null,2));" && \ - cd .techradar && npm install --legacy-peer-deps && npm run build:icons && cd .. -# Patcher next.config.js pour désactiver Fast Refresh (évite les rechargements en boucle) -RUN node -e "const fs=require('fs');const path='.techradar/next.config.js';let content=fs.readFileSync(path,'utf8');const webpackConfig=' webpack: (config, { dev, isServer }) => { if (dev && !isServer) { const idx=config.plugins.findIndex(p=>p.constructor.name===\"ReactRefreshPlugin\"); if(idx>=0)config.plugins.splice(idx,1); } return config; },';if(!content.includes('webpack:')){content=content.replace('reactStrictMode: true,',\"reactStrictMode: true,\\n \"+webpackConfig);fs.writeFileSync(path,content);}" +RUN npx techradar install +RUN node -e "const fs=require('fs');const p='.techradar/package.json';const pkg=JSON.parse(fs.readFileSync(p,'utf8'));pkg.scripts=pkg.scripts||{};pkg.scripts.prepare='';fs.writeFileSync(p,JSON.stringify(pkg,null,2));" +RUN cd .techradar && npm install --legacy-peer-deps +RUN cd .techradar && npm run build:icons # --- CONFIGURATION BUSINESS --- # Application de la logique Business (remplacement de la config et des données)