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
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
|
||||
WORKDIR /app
|
||||
EXPOSE 80
|
||||
EXPOSE 443
|
||||
|
||||
# Étape 2 : Build de l'application
|
||||
# 1. Étape de build (SDK .NET 6)
|
||||
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
|
||||
WORKDIR /src
|
||||
|
||||
# Copier le fichier projet et restaurer les dépendances
|
||||
COPY ["WF-WebAdmin/WF-WebAdmin/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
|
||||
# Copier le csproj et restaurer les dépendances
|
||||
COPY WF-WebAdmin/WF-WebAdmin/WF-WebAdmin.csproj ./
|
||||
RUN dotnet restore WF-WebAdmin.csproj
|
||||
|
||||
# Étape 3 : Publication de l'application
|
||||
FROM build AS publish
|
||||
RUN dotnet publish "WF-WebAdmin.csproj" -c Release -o /app/publish
|
||||
# Copier le reste du code et compiler
|
||||
COPY WF-WebAdmin/WF-WebAdmin/ ./
|
||||
RUN dotnet publish WF-WebAdmin.csproj -c Release -o /app/publish
|
||||
|
||||
# Étape 4 : Préparer l'image finale pour exécution
|
||||
FROM base AS final
|
||||
# 2. Étape finale (runtime .NET 6)
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS final
|
||||
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"]
|
||||
|
Loading…
Reference in new issue