File tree Expand file tree Collapse file tree 1 file changed +7
-16
lines changed
src/Application/src/RazorPagesTestSample Expand file tree Collapse file tree 1 file changed +7
-16
lines changed Original file line number Diff line number Diff line change 1
- # Use the official .NET 8 SDK image as a build stage
2
- FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
3
-
4
- # Set the working directory
1
+ FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env
5
2
WORKDIR /app
6
3
7
- # Copy the project file and restore dependencies
4
+ # Copy csproj and restore as distinct layers
8
5
COPY *.csproj ./
9
6
RUN dotnet restore
10
7
11
- # Copy the rest of the application code
8
+ # Copy everything else and build
12
9
COPY . ./
13
-
14
- # Build the application
15
10
RUN dotnet publish -c Release -o out
16
11
17
- # Use the official .NET 8 runtime image as a runtime stage
12
+ # Build runtime image
18
13
FROM mcr.microsoft.com/dotnet/aspnet:8.0
19
-
20
- # Set the working directory
21
14
WORKDIR /app
22
-
23
- # Copy the built application from the build stage
24
- COPY --from=build /app/out .
25
-
26
- # Set the entry point for the application
15
+ COPY --from=build-env /app/out .
16
+ # Default ASP.NET port changed with .NET 8.0
17
+ ENV ASPNETCORE_HTTP_PORTS=80
27
18
ENTRYPOINT ["dotnet" , "RazorPagesTestSample.dll" ]
You can’t perform that action at this time.
0 commit comments