-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
48 lines (47 loc) · 1.57 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
FROM mhart/alpine-node:latest
MAINTAINER Erik Stidham <estidham@gmail.com>
# Install bash (for wercker)
RUN apk update && apk add bash && rm -rf /var/cache/apk/*
# Install wkthml2pdf
RUN apk add --no-cache \
xvfb \
# Additionnal dependencies for better rendering
ttf-freefont \
fontconfig \
dbus \
&& \
# needed for pdf generation
apk add --no-cache wkhtmltopdf \
--repository http://dl-3.alpinelinux.org/alpine/edge/testing/ \
--allow-untrusted \
&& \
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 --page-size ${PAGE_SIZE:-Letter} $@ \n\
killall Xvfb\
' > /usr/bin/wkhtmltopdf && \
chmod +x /usr/bin/wkhtmltopdf && \
# Install hackmyresume
npm install -g hackmyresume && \
for x in $(\
# Needed to not run out of heap space for npm search
node --max-old-space-size=4000 \
# Search for all themes
/usr/bin/npm search jsonresume-theme | \
# Strip colors and cut just the name of the package
sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g" | cut -f1 -d' '); \
do \
npm install $x; \
done && \
for x in $(\
# Needed to not run out of heap space for npm search
node --max-old-space-size=4000 \
# Search for all themes
/usr/bin/npm search fresh-theme | \
# Strip colors and cut just the name of the package
sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g" | cut -f1 -d' '); \
do \
npm install $x; \
done && \
rm -rf /root/.npm