Compare commits

..

2 Commits

Author SHA1 Message Date
82348a0112 Merge pull request 'Refactored dockerfile' (#4) from test into main
Reviewed-on: #4
2026-03-03 14:50:40 +02:00
f3ac2cbdb0 Refactored dockerfile 2026-03-03 14:50:12 +02:00

View File

@@ -1,14 +1,12 @@
#FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base # Stage 1: Build the app using the SDK
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS base FROM ://mcr.microsoft.com AS build
WORKDIR /src
COPY . .
RUN dotnet publish "SampleApi/SampleApi.csproj" -c Release -o /app/publish
USER app # Stage 2: Run the app using the Runtime
FROM ://mcr.microsoft.com
WORKDIR /app WORKDIR /app
# Copy the compiled files from the 'build' stage to this stage
EXPOSE 8080 COPY --from=build /app/publish .
EXPOSE 8081 ENTRYPOINT ["dotnet", "SampleApi.dll"]
COPY . /app
FROM base AS final
WORKDIR /app
ENTRYPOINT ["dotnet", "SampleApi.dll"]