fix: utiliser WORKDIR au lieu de cd pour le build

- Utilisation de WORKDIR pour changer de répertoire de manière fiable
- Cela évite les problèmes avec cd qui peuvent échouer silencieusement
- WORKDIR garantit que npm est disponible dans le bon contexte
- Retour à /app après le build
This commit is contained in:
syoul
2025-12-03 16:00:13 +01:00
parent 789ee885a2
commit 0645e6b7b3

View File

@@ -53,10 +53,11 @@ RUN mkdir -p .techradar/data && \
cp custom.css .techradar/src/styles/custom.css 2>/dev/null || echo "custom.css not found, skipping" cp custom.css .techradar/src/styles/custom.css 2>/dev/null || echo "custom.css not found, skipping"
# Builder l'application en mode production pour éviter Fast Refresh # Builder l'application en mode production pour éviter Fast Refresh
# Vérifier que npm est disponible et que nous sommes dans le bon répertoire # Utiliser WORKDIR pour changer de répertoire de manière fiable
RUN which npm && pwd && ls -la .techradar/package.json WORKDIR /app/.techradar
RUN cd .techradar && pwd && which npm && npm --version && npm run build:data RUN npm run build:data
RUN cd .techradar && npm run build RUN npm run build
WORKDIR /app
# Exposition du port interne # Exposition du port interne
EXPOSE 3000 EXPOSE 3000