From 65b11dfd7842cf5517ef026084825e759df8c407 Mon Sep 17 00:00:00 2001 From: Fabian Eichhorner Date: Sat, 3 Nov 2018 23:37:29 +0100 Subject: [PATCH] merge branch '3-report-service' into 'master' --- service-reporting/Dockerfile | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/service-reporting/Dockerfile b/service-reporting/Dockerfile index b09b037..c372a86 100644 --- a/service-reporting/Dockerfile +++ b/service-reporting/Dockerfile @@ -1 +1,35 @@ -FROM alpine:latest +FROM microsoft/dotnet:2.2.100-preview3-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.0-preview3-aspnetcore-runtime +WORKDIR /app +COPY --from=build-env /app/out . + +# copy pdf library +# COPY libwkhtmltox.* ./ +# install additional 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/*.css ./assets/ +ENTRYPOINT ["dotnet", "PdfService.dll"] \ No newline at end of file -- 2.43.0