docker: publish Yavsc.Org / Api / Blogs artifacts to /app/publish
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.
This commit is contained in:
parent
c780ddfb07
commit
d068ff4061
2 changed files with 17 additions and 0 deletions
10
Dockerfile
10
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
|
# 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}
|
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/<project>/ 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
|
# Définition du répertoire d'exécution par défaut
|
||||||
CMD ["bash"]
|
CMD ["bash"]
|
||||||
|
|
|
||||||
|
|
@ -38,5 +38,12 @@ COPY . .
|
||||||
# 6. Compilation du serveur Web principal
|
# 6. Compilation du serveur Web principal
|
||||||
RUN dotnet build src/Yavsc.Org/Yavsc.Org.csproj -c Release --no-restore -clp:ErrorsOnly
|
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
|
# Définition du répertoire d'exécution par défaut
|
||||||
CMD ["bash"]
|
CMD ["bash"]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue