From 3f4c0720e1e3421431e7baa20882a4a4512a7fab Mon Sep 17 00:00:00 2001 From: ivar Date: Sun, 19 Oct 2025 23:41:23 +0200 Subject: Initial --- Dockerfile | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 Dockerfile (limited to 'Dockerfile') diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..9412036 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,23 @@ +FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build-env +WORKDIR /app +EXPOSE 5001 +# Copy csproj and restore as distinct layers +COPY src/PIT.ReservationService/PIT.ReservationService.csproj ./ +COPY src/PIT.ReservationService/nuget.config ./ +RUN dotnet restore + +# Copy everything else and build +COPY src/PIT.ReservationService ./ +RUN dotnet publish -c Release -o out + +# Build runtime image +FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 +WORKDIR /app +COPY --from=build-env /app/out . +ENTRYPOINT ["dotnet", "PIT.ReservationService.dll", "--environment=Production"] +RUN apt-get update \ + && apt-get install -y apt-transport-https \ + && apt-get upgrade -y \ + && apt-get autoremove -y \ + && apt-get clean \ + && rm -rf /var/cache/apt/archives -- cgit v1.3