diff --git a/code/server/Dockerfile b/code/server/Dockerfile index b1845e6..056f416 100644 --- a/code/server/Dockerfile +++ b/code/server/Dockerfile @@ -1,8 +1,3 @@ -FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base -WORKDIR /app -EXPOSE 80 -EXPOSE 443 - FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build WORKDIR /src COPY ["ApiLeapHit/ApiLeapHit.csproj", "ApiLeapHit/"] @@ -13,10 +8,15 @@ COPY . . WORKDIR "/src/ApiLeapHit" RUN dotnet build "ApiLeapHit.csproj" -c Release -o /app/build -FROM build AS publish -RUN dotnet publish "ApiLeapHit.csproj" -c Release -o /app/publish - -FROM base AS final +# Utilise l'image ASP.NET Core 6 pour exécuter l'application +FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS final WORKDIR /app -COPY --from=publish /app/publish . +EXPOSE 80 +EXPOSE 443 + +# Installation du client MySQL pour .NET Core +RUN apt-get update && apt-get install -y mysql-client && apt-get clean + +# Copie les fichiers de l'application dans l'image et définit l'entrée pour lancer l'application +COPY --from=build /app/build . ENTRYPOINT ["dotnet", "ApiLeapHit.dll"] \ No newline at end of file