Skip to content

Commit 023308b

Browse files
authored
Merge pull request #54 from DevOps-Group-B/SneekySnek-patch-2
Optimize Dockerfile by merging restore and publish
2 parents fbf96e0 + 79a8649 commit 023308b

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

itu-minitwit/Dockerfile

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,9 @@ COPY . .
77
# 2. Move into the Web project folder
88
WORKDIR /source/src/MiniTwit.Web
99

10-
# 3. Restore specifically for this project and then
11-
RUN dotnet restore &&
12-
13-
# 4. Publish
14-
# We explicitly point to the .csproj
15-
RUN dotnet publish MiniTwit.Web.csproj -c Release -o /app
10+
# 3. Restore and Publish in one step
11+
RUN dotnet restore && \
12+
dotnet publish MiniTwit.Web.csproj -c Release -o /app
1613

1714
# Stage 2: Runtime
1815
FROM mcr.microsoft.com/dotnet/aspnet:9.0

0 commit comments

Comments
 (0)