From f8043a5a10e694a9d355da9071f3cb6ca9727a31 Mon Sep 17 00:00:00 2001 From: Noan07 <84435602+Noan07@users.noreply.github.com> Date: Wed, 1 Mar 2023 12:23:07 +0100 Subject: [PATCH] :chart_with_upwards_trend: Modif dockerFile --- code/Dockerfile | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/code/Dockerfile b/code/Dockerfile index 7a5a754..1285831 100644 --- a/code/Dockerfile +++ b/code/Dockerfile @@ -1,12 +1,30 @@ FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build -WORKDIR /app + +# Première étape de la construction +WORKDIR /app/server RUN dotnet new console -COPY server/Server/Program.cs Program.cs +COPY Server/Program.cs Program.cs RUN dotnet publish -c Release -o out -FROM mcr.microsoft.com/dotnet/runtime:6.0 +# Deuxième étape de la construction +WORKDIR /app/api +COPY ApiLeapHit/ApiLeapHit.csproj . +COPY DTO/DTO.csproj DTO/ +COPY DataBase/DataBase.csproj DataBase/ +RUN dotnet restore +COPY . . +WORKDIR /app/api/ApiLeapHit +RUN dotnet build -c Release -o /app/build + +# Troisième étape de la construction +FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS final WORKDIR /app -COPY --from=build /app/out . -ENTRYPOINT ["dotnet", "app.dll"] +COPY --from=build /app/server/out . +COPY --from=build /app/api/build . +# Configuration de l'application +EXPOSE 80 +EXPOSE 443 EXPOSE 3131 +ENTRYPOINT ["dotnet", "ApiLeapHit.dll"] +