From 0708e3344842b35b7fa6b03d7e16cf668233ff21 Mon Sep 17 00:00:00 2001 From: Cheick Oumar D Date: Sun, 17 May 2026 17:33:20 +0200 Subject: [PATCH] fix: update Dockerfile to use correct Hugo base image and adjust build process --- Dockerfile | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 27cbe98..1a3cef1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,11 @@ -FROM klakegg/hugo:ext-alpine-onbuild AS builder +# ------------------------- +# 1) Build Hugo +# ------------------------- +FROM klakegg/hugo:ext-alpine AS builder WORKDIR /src + +# Copier tout le projet Hugo COPY . . # Build-time env vars used by Hugo templates. @@ -18,13 +23,22 @@ ENV HUGO_FORMBRICKS_ENV_ID=$HUGO_FORMBRICKS_ENV_ID ENV HUGO_FORMBRICKS_EVENT=$HUGO_FORMBRICKS_EVENT ENV HUGO_FORMBRICKS_SDK_URL=$HUGO_FORMBRICKS_SDK_URL -RUN mkdir -p /out \ - && hugo --config ./hugo.toml --environment production --minify --destination /out \ - && test -f /out/index.html +# Build du site +RUN hugo --minify -FROM nginx:1.27-alpine +# ------------------------- +# 2) Image finale NGINX +# ------------------------- +FROM nginx:alpine -COPY --from=builder /out /usr/share/nginx/html +# Supprimer la config par défaut +RUN rm -rf /usr/share/nginx/html/* +# Copier les fichiers générés par Hugo +COPY --from=builder /src/public /usr/share/nginx/html + +# Exposer le port EXPOSE 80 + +# Lancer Nginx CMD ["nginx", "-g", "daemon off;"]