From a50496411141ecc371249496167b6182d1370eb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Le=20Pr=C3=A9vost-Corvellec=20Arnault?= Date: Wed, 8 Apr 2026 20:27:50 +0200 Subject: [PATCH] Update Dockerfile to clear existing files before cloning repository --- server/Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/Dockerfile b/server/Dockerfile index 31ce61c..94b34b9 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -6,11 +6,13 @@ WORKDIR /usr/share/nginx/html # Image figée au clone ; le conteneur met à jour via refresh.sh (git pull origin main). # Seul le dossier content/ est extrait (sparse checkout) : léger et aligné sur la racine Nginx. +# L’image nginx:alpine place déjà des fichiers ici — il faut vider le répertoire avant git clone vers « . ». ARG TALKS_REPO_URL=https://git.specificat.io/arnault/Talks.git ARG TALKS_BRANCH=main ARG TALKS_SPARSE_DIR=content -RUN git clone --filter=blob:none --sparse --branch "${TALKS_BRANCH}" --single-branch "${TALKS_REPO_URL}" . \ +RUN find . -mindepth 1 -delete \ + && git clone --filter=blob:none --sparse --branch "${TALKS_BRANCH}" --single-branch "${TALKS_REPO_URL}" . \ && git sparse-checkout init --cone \ && git sparse-checkout set "${TALKS_SPARSE_DIR}" \ && git config --global --add safe.directory /usr/share/nginx/html