File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change
1
+ # Use the official .NET SDK image as a build environment
1
2
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env
2
3
WORKDIR /app
3
4
4
- # Copy csproj and restore as distinct layers
5
- COPY . src/Application/src/RazorPagesTestSample/* .csproj ./
5
+ # Copy the . csproj file and restore dependencies
6
+ COPY src/Application/src/RazorPagesTestSample/RazorPagesTestSample .csproj ./
6
7
RUN dotnet restore
7
8
8
- # Copy everything else and build
9
- COPY . .. src/Application/src/RazorPagesTestSample/. ./
9
+ # Copy the entire project and build the release version
10
+ COPY src/Application/src/RazorPagesTestSample/. ./
10
11
RUN dotnet publish -c Release -o out
11
12
12
- # Build runtime image
13
+ # Use the official ASP.NET Core runtime image
13
14
FROM mcr.microsoft.com/dotnet/aspnet:8.0
14
15
WORKDIR /app
15
16
COPY --from=build-env /app/out .
You can’t perform that action at this time.
0 commit comments