F# ASP.NET Core Dockerfile
The base Dockerfile I use for ASP.NET Core web applications. This is suitable for both F# and C# apps. Below I detail some design decisions and Docker best practices.
Dockerfile
FROM mcr.microsoft.com/dotnet/sdk:5.0-alpine AS build
WORKDIR /app
# Copy source code and compile
COPY ./ ./
RUN dotnet restore
RUN dotnet publish --configuration Release -o bin
# Build runtime image
FROM …