You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
WF-WebAdmin/Docker/Dockerfile

30 lines
851 B

# É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
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
# É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"]