genhttp-kestrel.dockerfile 868 B

123456789101112131415161718192021222324252627282930313233
  1. FROM mcr.microsoft.com/dotnet/sdk:10.0-alpine AS build
  2. WORKDIR /source
  3. ENV GENHTTP_ENGINE_NAME=KESTREL
  4. ENV GENHTTP_ENGINE_PACKAGE=GenHTTP.Core.Kestrel
  5. # copy csproj and restore as distinct layers
  6. COPY Benchmarks/*.csproj .
  7. RUN dotnet restore -r linux-musl-x64
  8. # copy and publish app and libraries
  9. COPY Benchmarks/ .
  10. RUN dotnet publish -c release -o /app -r linux-musl-x64 --no-restore --self-contained
  11. # final stage/image
  12. FROM mcr.microsoft.com/dotnet/runtime-deps:10.0-alpine
  13. ENV DOTNET_GCDynamicAdaptationMode=0 \
  14. DOTNET_EnableDiagnostics=0 \
  15. COMPlus_EnableDiagnostics=0 \
  16. COMPlus_DbgEnableMiniDump=0 \
  17. COMPlus_DbgEnableMiniDumpCollection=0 \
  18. COMPlus_DbgMiniDumpType=0 \
  19. DOTNET_TieredPGO=0 \
  20. DOTNET_TC_QuickJitForLoops=1 \
  21. DOTNET_TC_QuickJit=1
  22. WORKDIR /app
  23. COPY --from=build /app .
  24. ENTRYPOINT ["./Benchmarks"]
  25. EXPOSE 8080