Skip to content

Instantly share code, notes, and snippets.

@dangdennis
Created December 9, 2022 06:53
Show Gist options
  • Save dangdennis/57574dd1757f3e03605b4d5b81ad1755 to your computer and use it in GitHub Desktop.
Save dangdennis/57574dd1757f3e03605b4d5b81ad1755 to your computer and use it in GitHub Desktop.
F# asp.net dockerfile
FROM mcr.microsoft.com/dotnet/sdk:7.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 mcr.microsoft.com/dotnet/aspnet:7.0-alpine AS runtime
WORKDIR /app
COPY --from=build /app/bin .
# Rename WebApiTest.dll to YourProjectName.dll
ENTRYPOINT ["dotnet", "WebApiTest.dll", "--urls", "http://0.0.0.0:8080"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment