From 6bc607916c96927ede73f4ef303b2fd2f9ef73e7 Mon Sep 17 00:00:00 2001 From: Vitaliy Vlasov Date: Tue, 6 Mar 2018 17:37:34 +0200 Subject: [PATCH] Install wkhtmltoimage for PNG generation --- Dockerfile | 5 +++++ html2png.sh | 3 +++ 2 files changed, 8 insertions(+) create mode 100755 html2png.sh diff --git a/Dockerfile b/Dockerfile index ce2947a..83164d0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,7 +23,12 @@ RUN lein uberjar FROM clojure WORKDIR /root/ +RUN apt-get update +RUN apt-get -y install xvfb +RUN apt-get -y install wkhtmltopdf + COPY --from=builder /usr/src/app/target/uberjar/commiteth.jar . +COPY html2png.sh . CMD [""] ENTRYPOINT ["/usr/bin/java", "-Duser.timezone=UTC", "-Dconf=config-test.edn", "-jar", "/root/commiteth.jar"] diff --git a/html2png.sh b/html2png.sh new file mode 100755 index 0000000..781d8d5 --- /dev/null +++ b/html2png.sh @@ -0,0 +1,3 @@ +#!/bin/bash -eu +# need to run wkhtmltoimage in quiet mode because it misuses stdout +xvfb-run -a -s "-screen 0 640x480x16" wkhtmltoimage -q "$@" 2>/dev/null