📈 DockerFile
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
parent
1aac4aa377
commit
8dd050b647
@ -1,32 +1,27 @@
|
|||||||
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
|
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build1
|
||||||
|
WORKDIR /app
|
||||||
# Première étape de la construction
|
|
||||||
WORKDIR /app/server
|
|
||||||
RUN dotnet new console
|
RUN dotnet new console
|
||||||
COPY server/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
|
FROM mcr.microsoft.com/dotnet/runtime:6.0 AS build2
|
||||||
WORKDIR /app/api
|
WORKDIR /src
|
||||||
COPY server/ApiLeapHit/. .
|
COPY ["server/ApiLeapHit/ApiLeapHit.csproj", "ApiLeapHit/"]
|
||||||
COPY server/DTO/DTO.csproj DTO/
|
COPY ["server/DTO/DTO.csproj", "DTO/"]
|
||||||
COPY server/DataBase/DataBase.csproj DataBase/
|
COPY ["server/DataBase/DataBase.csproj", "DataBase/"]
|
||||||
RUN dotnet restore "ApiLeapHit.csproj"
|
RUN dotnet restore "server/ApiLeapHit/ApiLeapHit.csproj"
|
||||||
COPY . .
|
COPY . .
|
||||||
WORKDIR /app/api/ApiLeapHit
|
WORKDIR "/src/ApiLeapHit"
|
||||||
RUN dotnet build "ApiLeapHit.csproj" -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 base
|
||||||
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS final
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY --from=build /app/server/out .
|
|
||||||
COPY --from=build /app/api/publish .
|
|
||||||
|
|
||||||
# Configuration de l'application
|
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
EXPOSE 443
|
EXPOSE 443
|
||||||
EXPOSE 3131
|
|
||||||
ENTRYPOINT ["dotnet", "app.dll"]
|
COPY --from=build2 /app/build .
|
||||||
|
COPY --from=build2 /app/publish .
|
||||||
|
|
||||||
|
ENTRYPOINT ["dotnet", "ApiLeapHit.dll"]
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in new issue