Skip to content

Commit d0ccf68

Browse files
authored
Update Dockerfile
1 parent 77a70a2 commit d0ccf68

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/Application/Dockerfile

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

5-
# Copy the .csproj file and restore dependencies
6-
# COPY src/Application/src/RazorPagesTestSample/*.csproj ./
7-
# RUN dotnet restore
4+
# Copy csproj and restore as distinct layers
5+
COPY *.csproj ./
6+
RUN dotnet restore
87

9-
# Copy the entire project and build the release version
10-
COPY src/Application/src/RazorPagesTestSample/ . ./
8+
# Copy everything else and build
9+
COPY . ./
1110
RUN dotnet publish -c Release -o out
1211

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

0 commit comments

Comments
 (0)