📈 DockerFile
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
parent
f8043a5a10
commit
f48b5e2fc7
@ -1,30 +1,23 @@
|
|||||||
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
|
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
|
||||||
|
WORKDIR /app
|
||||||
# Première étape de la construction
|
EXPOSE 80
|
||||||
WORKDIR /app/server
|
EXPOSE 443
|
||||||
RUN dotnet new console
|
|
||||||
COPY Server/Program.cs Program.cs
|
|
||||||
RUN dotnet publish -c Release -o out
|
|
||||||
|
|
||||||
# Deuxième étape de la construction
|
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
|
||||||
WORKDIR /app/api
|
WORKDIR /src
|
||||||
COPY ApiLeapHit/ApiLeapHit.csproj .
|
COPY ["server/ApiLeapHit/ApiLeapHit.csproj", "ApiLeapHit/"]
|
||||||
COPY DTO/DTO.csproj DTO/
|
COPY ["server/DTO/DTO.csproj", "DTO/"]
|
||||||
COPY DataBase/DataBase.csproj DataBase/
|
COPY ["server/DataBase/DataBase.csproj", "DataBase/"]
|
||||||
RUN dotnet restore
|
RUN dotnet restore "server/ApiLeapHit/ApiLeapHit.csproj"
|
||||||
COPY . .
|
COPY . .
|
||||||
WORKDIR /app/api/ApiLeapHit
|
WORKDIR "/src/ApiLeapHit"
|
||||||
RUN dotnet build -c Release -o /app/build
|
RUN dotnet build "ApiLeapHit.csproj" -c Release -o /app/build
|
||||||
|
|
||||||
# Troisième étape de la construction
|
FROM build AS publish
|
||||||
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS final
|
RUN dotnet publish "ApiLeapHit.csproj" -c Release -o /app/publish
|
||||||
WORKDIR /app
|
|
||||||
COPY --from=build /app/server/out .
|
|
||||||
COPY --from=build /app/api/build .
|
|
||||||
|
|
||||||
# Configuration de l'application
|
FROM base AS final
|
||||||
EXPOSE 80
|
WORKDIR /app
|
||||||
EXPOSE 443
|
COPY --from=publish /app/publish .
|
||||||
EXPOSE 3131
|
|
||||||
ENTRYPOINT ["dotnet", "ApiLeapHit.dll"]
|
ENTRYPOINT ["dotnet", "ApiLeapHit.dll"]
|
||||||
|
|
||||||
|
Loading…
Reference in new issue