FROM microsoft/dotnet:2.2-sdk 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 microsoft/dotnet:2.2-aspnetcore-runtime LABEL maintainer="Fabian Eichhorner " WORKDIR /app COPY --from=build-env /app/out . # set ports EXPOSE 8083 ENV ASPNETCORE_URLS=http://+:8083 # install pdf libaries RUN apt-get update \ && apt-get install -y --no-install-recommends \ zlib1g \ fontconfig \ libfreetype6 \ libx11-6 \ libxext6 \ libxrender1 \ && curl -o /usr/lib/libwkhtmltox.so \ --location \ https://github.com/rdvojmoc/DinkToPdf/raw/v1.0.8/v0.12.4/64%20bit/libwkhtmltox.so # copy assets COPY assets/*.* ./assets/ ENTRYPOINT ["dotnet", "PdfService.dll"]