Files
administration/Dockerfile
2025-07-25 12:14:28 +02:00

30 lines
1.3 KiB
Docker
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Consultez https://aka.ms/customizecontainer pour savoir comment personnaliser votre conteneur de débogage et comment Visual Studio utilise ce Dockerfile pour générer vos images afin daccélérer le débogage.
# Cet index est utilisé lors de lexécution à partir de VS en mode rapide (par défaut pour la configuration de débogage)
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
# USER $APP_UID
WORKDIR /app
EXPOSE 8080
EXPOSE 8081
# Cette phase est utilisée pour générer le projet de service
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
ARG BUILD_CONFIGURATION=Release
WORKDIR /src
COPY ["administration.csproj", "."]
RUN dotnet restore "./administration.csproj"
COPY . .
WORKDIR "/src/."
RUN dotnet build "./administration.csproj" -c $BUILD_CONFIGURATION -o /app/build
# Cette étape permet de publier le projet de service à copier dans la phase finale
FROM build AS publish
ARG BUILD_CONFIGURATION=Release
RUN dotnet publish "./administration.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
# Cette phase est utilisée en production ou lors de lexécution à partir de VS en mode normal (par défaut quand la configuration de débogage nest pas utilisée)
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "administration.dll"]