Skip to content

Commit c6565e5

Browse files
authored
Create Dockerfile
1 parent 618cc1e commit c6565e5

File tree

1 file changed

+19
-0
lines changed
  • src/Application/src/RazorPagesTestSample

1 file changed

+19
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Use the official .NET SDK image as a build environment
2+
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env
3+
WORKDIR /app
4+
5+
# Copy the .csproj file and restore dependencies
6+
COPY src/Application/src/RazorPagesTestSample/RazorPagesTestSample.csproj ./
7+
RUN dotnet restore
8+
9+
# Copy the entire project and build the release version
10+
COPY src/Application/src/RazorPagesTestSample/. ./
11+
RUN dotnet publish -c Release -o out
12+
13+
# Use the official ASP.NET Core runtime image
14+
FROM mcr.microsoft.com/dotnet/aspnet:8.0
15+
WORKDIR /app
16+
COPY --from=build-env /app/out .
17+
# Default ASP.NET port changed with .NET 8.0
18+
ENV ASPNETCORE_HTTP_PORTS=80
19+
ENTRYPOINT ["dotnet", "RazorPagesTestSample.dll"]

0 commit comments

Comments
 (0)