Skip to content

Commit 8f456ba

Browse files
committed
move dockerfile
1 parent 15d3704 commit 8f456ba

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed
Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env
2-
WORKDIR /app
3-
4-
# Copy csproj and restore as distinct layers
5-
COPY *.csproj ./
6-
RUN dotnet restore
7-
8-
# Copy everything else and build
9-
COPY . ./
10-
RUN dotnet publish -c Release -o out
11-
12-
# Build runtime image
13-
FROM mcr.microsoft.com/dotnet/aspnet:8.0
14-
WORKDIR /app
15-
COPY --from=build-env /app/out .
16-
# Default ASP.NET port changed with .NET 8.0
17-
ENV ASPNETCORE_HTTP_PORTS=80
1+
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env
2+
WORKDIR /app
3+
4+
# Copy csproj and restore as distinct layers
5+
COPY *.csproj ./
6+
RUN dotnet restore
7+
8+
# Copy everything else and build
9+
COPY . ./
10+
RUN dotnet publish -c Release -o out
11+
12+
# Build runtime image
13+
FROM mcr.microsoft.com/dotnet/aspnet:8.0
14+
WORKDIR /app
15+
COPY --from=build-env /app/out .
16+
# Default ASP.NET port changed with .NET 8.0
17+
ENV ASPNETCORE_HTTP_PORTS=80
1818
ENTRYPOINT ["dotnet", "RazorPagesTestSample.dll"]

0 commit comments

Comments
 (0)