From 13acabffeaf5e990cdb7c7c15e9090054c4a04b5 Mon Sep 17 00:00:00 2001 From: Noan RANDON Date: Wed, 1 Mar 2023 12:35:26 +0100 Subject: [PATCH] :chart_with_upwards_trend: DockerFile --- code/Dockerfile | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/code/Dockerfile b/code/Dockerfile index 1285831..0c99efe 100644 --- a/code/Dockerfile +++ b/code/Dockerfile @@ -3,28 +3,30 @@ FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build # Première étape de la construction WORKDIR /app/server RUN dotnet new console -COPY Server/Program.cs Program.cs +COPY server/Server/Program.cs Program.cs RUN dotnet publish -c Release -o out # 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 ["ApiLeapHit/ApiLeapHit.csproj", "ApiLeapHit/"] +COPY ["DTO/DTO.csproj", "DTO/"] +COPY ["DataBase/DataBase.csproj", "DataBase/"] +RUN dotnet restore "ApiLeapHit/ApiLeapHit.csproj" COPY . . WORKDIR /app/api/ApiLeapHit -RUN dotnet build -c Release -o /app/build +RUN dotnet build "ApiLeapHit.csproj" -c Release -o /app/build +FROM build AS publish +RUN dotnet publish "ApiLeapHit.csproj" -c Release -o /app/publish # Troisième étape de la construction FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS final WORKDIR /app COPY --from=build /app/server/out . -COPY --from=build /app/api/build . +COPY --from=build /app/api/publish . # Configuration de l'application EXPOSE 80 EXPOSE 443 EXPOSE 3131 -ENTRYPOINT ["dotnet", "ApiLeapHit.dll"] +ENTRYPOINT ["dotnet", "app.dll"]