From 36cab3f5eaf6e68818596286a7281019b4523dd8 Mon Sep 17 00:00:00 2001 From: khwezi Date: Tue, 3 Mar 2026 17:43:07 +0200 Subject: [PATCH] Refactored dockerfile stage 2 ports exposure --- Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index a084234..075469e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,10 +2,6 @@ FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build WORKDIR /src -# expose ports -ENV ASPNETCORE_HTTP_PORTS=8081 -EXPOSE 8081 - # 1. Copy the .sln and .csproj files first to restore dependencies # This makes builds faster by caching the 'restore' layer COPY ["SampleApi/SampleApi.csproj", "SampleApi/"] @@ -26,6 +22,10 @@ RUN dotnet publish "SampleApi/SampleApi.csproj" \ FROM mcr.microsoft.com/dotnet/aspnet:8.0 WORKDIR /app +# expose ports +ENV ASPNETCORE_HTTP_PORTS=8081 +EXPOSE 8081 + # Copy the contents directly COPY --from=build /app/publish . -- 2.47.3