deploiement 7
continuous-integration/drone/push Build was killed
Details
continuous-integration/drone/push Build was killed
Details
parent
37a0b06885
commit
0af5d95878
@ -1,29 +1,27 @@
|
|||||||
# Étape 1 : Image de base ASP.NET pour le runtime
|
# 1. Étape de build (SDK .NET 6)
|
||||||
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
|
|
||||||
WORKDIR /app
|
|
||||||
EXPOSE 80
|
|
||||||
EXPOSE 443
|
|
||||||
|
|
||||||
# Étape 2 : Build de l'application
|
|
||||||
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
|
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
|
|
||||||
# Copier le fichier projet et restaurer les dépendances
|
# Copier le csproj et restaurer les dépendances
|
||||||
COPY ["WF-WebAdmin/WF-WebAdmin/WF-WebAdmin.csproj", "./"]
|
COPY WF-WebAdmin/WF-WebAdmin/WF-WebAdmin.csproj ./
|
||||||
RUN dotnet restore "WF-WebAdmin.csproj"
|
RUN dotnet restore WF-WebAdmin.csproj
|
||||||
|
|
||||||
# Copier tout le reste des fichiers et compiler
|
|
||||||
COPY WF-WebAdmin/WF-WebAdmin/. .
|
|
||||||
RUN dotnet build "WF-WebAdmin.csproj" -c Release -o /app/build
|
|
||||||
|
|
||||||
# Étape 3 : Publication de l'application
|
# Copier le reste du code et compiler
|
||||||
FROM build AS publish
|
COPY WF-WebAdmin/WF-WebAdmin/ ./
|
||||||
RUN dotnet publish "WF-WebAdmin.csproj" -c Release -o /app/publish
|
RUN dotnet publish WF-WebAdmin.csproj -c Release -o /app/publish
|
||||||
|
|
||||||
# Étape 4 : Préparer l'image finale pour exécution
|
# 2. Étape finale (runtime .NET 6)
|
||||||
FROM base AS final
|
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS final
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY --from=publish /app/publish .
|
|
||||||
|
|
||||||
# Lancer l'application
|
# Désactiver le rechargement de config pour éviter les erreurs inotify
|
||||||
|
ENV ASPNETCORE_HOSTBUILDER__RELOADCONFIGONCHANGE=false
|
||||||
|
|
||||||
|
# Copier les binaires publiés
|
||||||
|
COPY --from=build /app/publish ./
|
||||||
|
|
||||||
|
# Exposer le port HTTP (80) ; adapte si besoin
|
||||||
|
EXPOSE 80
|
||||||
|
|
||||||
|
# Lancement
|
||||||
ENTRYPOINT ["dotnet", "WF-WebAdmin.dll"]
|
ENTRYPOINT ["dotnet", "WF-WebAdmin.dll"]
|
||||||
|
Loading…
Reference in new issue