I was following example docker for .NET core. There I created the dockerfile as per tutorial. I build the image and successfully run it on port 8081:80. so I can see my application running on localhost:8081. But I have some confusion there, how it is running, which server actually is responsible for running the container. I am a bit confused here cause I don't have the clear picture of what is happening there. Any resource will be much appreciated. Thanks.
here is my dockerfile
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build-env
WORKDIR /app
# Copy csproj and restore as distinct layers
COPY *.csproj ./
RUN dotnet restore
# Copy everything else and build
COPY . ./
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", "aspnetapp.dll"]
By looking at the source Dockerfile -
None of them install or configure any other web servers (Nginx, Apache etc.) to override the default web server of ASP.NET Core so it has to be Kestrel.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With