Skip to content

Commit 5099c7b

Browse files
committed
Add Dockerfile for .NET 8 SDK and runtime setup
1 parent b3e89a3 commit 5099c7b

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

src/Application/src/Dockerfile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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
5+
WORKDIR /app
6+
7+
# Copy the project file and restore dependencies
8+
COPY *.csproj ./
9+
RUN dotnet restore
10+
11+
# Copy the rest of the application code
12+
COPY . ./
13+
14+
# Build the application
15+
RUN dotnet publish -c Release -o out
16+
17+
# Use the official .NET 8 runtime image as a runtime stage
18+
FROM mcr.microsoft.com/dotnet/aspnet:8.0
19+
20+
# Set the working directory
21+
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
27+
ENTRYPOINT ["dotnet", "RazorPagesTestSample.dll"]

0 commit comments

Comments
 (0)