From d068ff4061bdb105bbab74a77264d84cb113db87 Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Sat, 27 Jun 2026 16:12:16 +0100 Subject: [PATCH] docker: publish Yavsc.Org / Api / Blogs artifacts to /app/publish MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a 'dotnet publish' step at the end of both Dockerfiles so the runtime images (Dockerfile.runtime / .blogs / .api) can COPY the published output via --from=build-env. Before this commit, the Dockerfiles only ran 'dotnet build' and ended with CMD ["bash"] — i.e. they were pure build-env images with no consumable artifact for runtime use. Dockerfile publishes Yavsc.Org, Yavsc.Api and Yavsc.Blogs (used by docker-publish-android.yml which extracts the APK). Dockerfile.backend publishes Yavsc.Org only (used by docker-publish-backend.yml for the pazof/yavsc production image). Appsettings are NOT published: they are supplied at runtime via BuildKit --mount=type=secret (see Dockerfile.runtime in the next commits) or via a docker-compose volume. --- Dockerfile | 10 ++++++++++ Dockerfile.backend | 7 +++++++ 2 files changed, 17 insertions(+) diff --git a/Dockerfile b/Dockerfile index 904743dd..40596753 100644 --- a/Dockerfile +++ b/Dockerfile @@ -45,5 +45,15 @@ RUN dotnet build src/Yavsc.Blogs/Yavsc.Blogs.csproj -c Release --no-restore -clp # 6. Compilation du serveur Web principal Injecter l'option -r avec la variable RUN dotnet build src/PostIt/PostIt.Android/PostIt.Android.csproj -c Release --no-restore -clp:ErrorsOnly -r ${ANDROID_TARGET_RID} +# 7. Publication des artefacts pour les images runtime (Dockerfile.runtime*) +# Le repertoire /app/publish// est copie tel quel dans l'image +# runtime via --from=build-env. Les appsettings ne sont PAS publies ici : +# ils sont fournis au runtime soit via BuildKit secret mount, soit via +# volume monte par docker-compose. +RUN mkdir -p /app/publish +RUN dotnet publish src/Yavsc.Org/Yavsc.Org.csproj -c Release --no-build -o /app/publish/Yavsc.Org +RUN dotnet publish src/Yavsc.Api/Yavsc.Api.csproj -c Release --no-build -o /app/publish/Yavsc.Api +RUN dotnet publish src/Yavsc.Blogs/Yavsc.Blogs.csproj -c Release --no-build -o /app/publish/Yavsc.Blogs + # Définition du répertoire d'exécution par défaut CMD ["bash"] diff --git a/Dockerfile.backend b/Dockerfile.backend index d9415606..c89d694e 100644 --- a/Dockerfile.backend +++ b/Dockerfile.backend @@ -38,5 +38,12 @@ COPY . . # 6. Compilation du serveur Web principal RUN dotnet build src/Yavsc.Org/Yavsc.Org.csproj -c Release --no-restore -clp:ErrorsOnly +# 7. Publication de l'artefact Yavsc.Org pour l'image runtime (Dockerfile.runtime). +# Copie depuis /app/publish/Yavsc.Org/ via --from=build-env. Les appsettings +# ne sont PAS publiés ici : fournis au runtime via BuildKit secret mount ou +# volume docker-compose. +RUN mkdir -p /app/publish +RUN dotnet publish src/Yavsc.Org/Yavsc.Org.csproj -c Release --no-build -o /app/publish/Yavsc.Org + # Définition du répertoire d'exécution par défaut CMD ["bash"]