December 2019
Intermediate to advanced
510 pages
11h 33m
English
This section is focused on the deployment step of the .NET worker template. We will proceed by running our service on a Docker Linux image. As we have already seen in Chapter 12, The Containerization of Services, we will use Docker to run the application in a container.
Let's start by configuring the Dockerfile in the project folder:
FROM mcr.microsoft.com/dotnet/core/runtime:3.0 AS baseWORKDIR /app# Step 1 - Building the projectFROM mcr.microsoft.com/dotnet/core/sdk:3.0 AS buildWORKDIR /srcCOPY ["HealthCheckWorker.csproj", "./"]RUN dotnet restore "./HealthCheckWorker.csproj"COPY . .WORKDIR "/src/."RUN dotnet build "HealthCheckWorker.csproj" -c Release -o /app/build# Step 2 - Publish the projectFROM build ...
Read now
Unlock full access