diff options
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 |
