genhttp.dockerfile 595 B

123456789101112131415161718192021
  1. FROM mcr.microsoft.com/dotnet/core/sdk:3.0-alpine AS build
  2. WORKDIR /app
  3. # copy csproj and restore as distinct layers
  4. COPY Benchmarks/*.csproj ./Benchmarks/
  5. WORKDIR /app/Benchmarks
  6. RUN dotnet restore
  7. # copy and build app and libraries
  8. WORKDIR /app/
  9. COPY Benchmarks/. ./Benchmarks/
  10. WORKDIR /app/Benchmarks
  11. RUN dotnet publish -c Release -r linux-musl-x64 -o out --self-contained true /p:PublishTrimmed=true
  12. FROM mcr.microsoft.com/dotnet/core/runtime-deps:3.0-alpine AS runtime
  13. ENV DOCKER_FLAVOR=linux
  14. WORKDIR /app
  15. COPY --from=build /app/Benchmarks/out ./
  16. ENTRYPOINT ["./Benchmarks"]
  17. EXPOSE 8080