Skip to content

Commit 3fdc9cc

Browse files
authored
Update Dockerfile
1 parent 5a4deee commit 3fdc9cc

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/Application/Dockerfile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1+
# Use the official .NET SDK image as a build environment
12
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env
23
WORKDIR /app
34

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 ./
67
RUN dotnet restore
78

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/. ./
1011
RUN dotnet publish -c Release -o out
1112

12-
# Build runtime image
13+
# Use the official ASP.NET Core runtime image
1314
FROM mcr.microsoft.com/dotnet/aspnet:8.0
1415
WORKDIR /app
1516
COPY --from=build-env /app/out .

0 commit comments

Comments
 (0)