diff options
| author | ivar <i@oiee.no> | 2025-10-19 23:41:23 +0200 |
|---|---|---|
| committer | ivar <i@oiee.no> | 2025-10-19 23:41:23 +0200 |
| commit | 3f4c0720e1e3421431e7baa20882a4a4512a7fab (patch) | |
| tree | 734ca81d7d0841d8863e3f523ebba14c282dc681 /Dockerfile | |
| download | fagprove-3f4c0720e1e3421431e7baa20882a4a4512a7fab.tar.xz fagprove-3f4c0720e1e3421431e7baa20882a4a4512a7fab.zip | |
Diffstat (limited to 'Dockerfile')
| -rw-r--r-- | Dockerfile | 23 |
1 files changed, 23 insertions, 0 deletions
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 |
