deploiement 5
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
parent
d11ce9cbc9
commit
0ba0670270
@ -1,22 +1,31 @@
|
||||
# Étape 1 : Build de l'application
|
||||
# É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 avec le SDK .NET
|
||||
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
|
||||
WORKDIR /src
|
||||
|
||||
# Copier les fichiers de projet et restaurer les dépendances
|
||||
COPY WF-WebAdmin/WF-WebAdmin/WF-WebAdmin.csproj ./WF-WebAdmin/WF-WebAdmin/
|
||||
RUN dotnet restore ./WF-WebAdmin/WF-WebAdmin/WF-WebAdmin.csproj
|
||||
# Copier le fichier .csproj et restaurer les dépendances
|
||||
COPY ["WF-WebAdmin/WF-WebAdmin/WF-WebAdmin.csproj", "./"]
|
||||
RUN dotnet restore "WF-WebAdmin.csproj"
|
||||
|
||||
# Copier tout le reste et publier
|
||||
# Copier tout le reste des fichiers sources
|
||||
COPY . .
|
||||
RUN dotnet publish ./WF-WebAdmin/WF-WebAdmin/WF-WebAdmin.csproj -c Release -o /app
|
||||
|
||||
# Étape 2 : Image runtime
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS runtime
|
||||
WORKDIR /app
|
||||
COPY --from=build /app .
|
||||
# Compiler le projet
|
||||
RUN dotnet build "WF-WebAdmin.csproj" -c Release -o /app/build
|
||||
|
||||
# Exposer le port utilisé par l'application
|
||||
EXPOSE 5000
|
||||
# Étape 3 : Publication de l'application
|
||||
FROM build AS publish
|
||||
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
|
||||
WORKDIR /app
|
||||
COPY --from=publish /app/publish .
|
||||
|
||||
# Lancer l'application
|
||||
ENTRYPOINT ["dotnet", "WF-WebAdmin.dll"]
|
||||
|
Loading…
Reference in new issue