From 51d3412cc1cf7c85d00e095d7b5afbad7add5769 Mon Sep 17 00:00:00 2001 From: Ryan Date: Thu, 29 Sep 2016 13:26:02 +0200 Subject: [PATCH] added wkhtmltopdf --- Dockerfile | 25 +++++++++++++++++++++++++ README.md | 4 +++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 266b092..5be1393 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,5 +4,30 @@ MAINTAINER Ryan Kes # Install pygments (for syntax highlighting) RUN apk update && apk add bash && rm -rf /var/cache/apk/* +RUN apk add --no-cache \ + xvfb \ + # Additionnal dependencies for better rendering + ttf-freefont \ + fontconfig \ + dbus \ + && \ + + # Install wkhtmltopdf from `testing` repository + apk add qt5-qtbase-dev \ + wkhtmltopdf \ + --no-cache \ + --repository http://dl-3.alpinelinux.org/alpine/edge/testing/ \ + --allow-untrusted \ + && \ + + # Wrapper for xvfb + mv /usr/bin/wkhtmltopdf /usr/bin/wkhtmltopdf-origin && \ + echo $'#!/usr/bin/env sh\n\ +Xvfb :0 -screen 0 1024x768x24 -ac +extension GLX +render -noreset & \n\ +DISPLAY=:0.0 wkhtmltopdf-origin $@ \n\ +killall Xvfb\ +' > /usr/bin/wkhtmltopdf && \ + chmod +x /usr/bin/wkhtmltopdf + # Install hackmyresume RUN npm install -g hackmyresume diff --git a/README.md b/README.md index 415d94d..02eb358 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,9 @@ # Docker Alpine Hackmyresume Bash -Minimal container with [Hackmyresume](https://www.npmjs.com/package/hackmyresume) & Bash installed. Built to be used with [wercker](http://wercker.com/). Leverages [mhart/alpine-node](https://hub.docker.com/r/mhart/alpine-node/) base image. +(Not so) Minimal container with [Hackmyresume](https://www.npmjs.com/package/hackmyresume), wkhtmltopdf & Bash installed. Built to be used with [wercker](http://wercker.com/). Leverages [mhart/alpine-node](https://hub.docker.com/r/mhart/alpine-node/) base image. + +Hopefully will use official wkhtmltopdf package once it's in stable ## Usage