📈 DockerFile
continuous-integration/drone/push Build is failing Details

Server
Noan RANDON 2 years ago
parent 4efea53f29
commit 13acabffea

@ -3,28 +3,30 @@ FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
# Première étape de la construction # Première étape de la construction
WORKDIR /app/server WORKDIR /app/server
RUN dotnet new console RUN dotnet new console
COPY Server/Program.cs Program.cs COPY server/Server/Program.cs Program.cs
RUN dotnet publish -c Release -o out RUN dotnet publish -c Release -o out
# Deuxième étape de la construction # Deuxième étape de la construction
WORKDIR /app/api WORKDIR /app/api
COPY ApiLeapHit/ApiLeapHit.csproj . COPY ["ApiLeapHit/ApiLeapHit.csproj", "ApiLeapHit/"]
COPY DTO/DTO.csproj DTO/ COPY ["DTO/DTO.csproj", "DTO/"]
COPY DataBase/DataBase.csproj DataBase/ COPY ["DataBase/DataBase.csproj", "DataBase/"]
RUN dotnet restore RUN dotnet restore "ApiLeapHit/ApiLeapHit.csproj"
COPY . . COPY . .
WORKDIR /app/api/ApiLeapHit 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 # Troisième étape de la construction
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS final FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS final
WORKDIR /app WORKDIR /app
COPY --from=build /app/server/out . COPY --from=build /app/server/out .
COPY --from=build /app/api/build . COPY --from=build /app/api/publish .
# Configuration de l'application # Configuration de l'application
EXPOSE 80 EXPOSE 80
EXPOSE 443 EXPOSE 443
EXPOSE 3131 EXPOSE 3131
ENTRYPOINT ["dotnet", "ApiLeapHit.dll"] ENTRYPOINT ["dotnet", "app.dll"]

Loading…
Cancel
Save