File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- # Use the official ASP.NET Core runtime as a parent image
2- FROM mcr.microsoft.com/dotnet/aspnet:7 .0 AS base
1+ # Use official ASP.NET Core image as the base
2+ FROM mcr.microsoft.com/dotnet/aspnet:9 .0 AS base
33WORKDIR /app
44EXPOSE 80
5- EXPOSE 443
5+ ENV ASPNETCORE_URLS=http://+:80
66
7- # Use the official .NET SDK as a build image
8- FROM mcr.microsoft.com/dotnet/sdk:7 .0 AS build
7+ # Build stage
8+ FROM mcr.microsoft.com/dotnet/sdk:9 .0 AS build
99WORKDIR /src
10- COPY ["src/NetworkInfrastructure.Web/NetworkInfrastructure.Web.csproj" , "NetworkInfrastructure.Web/" ]
11- # Copy other .csproj files if there are any in the solution that NetworkInfrastructure.Web depends on
12- # For example: COPY ["src/NetworkInfrastructure.AnotherProject/NetworkInfrastructure.AnotherProject.csproj", "NetworkInfrastructure.AnotherProject/"]
13- RUN dotnet restore "NetworkInfrastructure.Web/NetworkInfrastructure.Web.csproj"
1410COPY . .
15- WORKDIR "/src/NetworkInfrastructure.Web"
16- RUN dotnet build "NetworkInfrastructure.Web.csproj" -c Release -o /app/build
11+ RUN dotnet restore
12+ RUN dotnet publish -c Release -o /app/publish
1713
18- FROM build AS publish
19- RUN dotnet publish "NetworkInfrastructure.Web.csproj" -c Release -o /app/publish /p:UseAppHost=false
20-
21- # Build runtime image
14+ # Final stage
2215FROM base AS final
2316WORKDIR /app
24- COPY --from=publish /app/publish .
17+ COPY --from=build /app/publish .
2518ENTRYPOINT ["dotnet" , "NetworkInfrastructure.Web.dll" ]
You can’t perform that action at this time.
0 commit comments