-
Notifications
You must be signed in to change notification settings - Fork 9
/
Dockerfile
51 lines (40 loc) · 1.6 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
49
50
51
FROM golang:1.4
MAINTAINER Erlend Sand Bærland <[email protected]>
ENV WKHTML_MAJOR 0.12
ENV WKHTML_MINOR 3
ENV ALPHA "https://bitbucket.org/wkhtmltopdf/wkhtmltopdf/downloads/wkhtmltox-0.13.0-alpha-7b36694_linux-jessie-amd64.deb"
# Builds the wkhtmltopdf download URL based on version numbers above
ENV DOWNLOAD_URL "http://download.gna.org/wkhtmltopdf/${WKHTML_MAJOR}/${WKHTML_MAJOR}.${WKHTML_MINOR}/wkhtmltox-${WKHTML_MAJOR}.${WKHTML_MINOR}_linux-generic-amd64.tar.xz"
# Create system user first so the User ID gets assigned
# consistently, regardless of dependencies added later
RUN useradd -rM appuser && \
apt-get update && \
apt-get install -y --no-install-recommends curl \
fontconfig libfontconfig1 libfreetype6 fonts-liberation \
libpng12-0 libjpeg62-turbo \
libssl1.0.0 libx11-6 libxext6 libxrender1 xz-utils \
xfonts-base xfonts-75dpi
#RUN curl -o /tmp/wkhtmltox.deb $ALPHA && \
# dpkg -i /tmp/wkhtmltox.deb && \
# rm /tmp/wkhtmltox.deb
RUN curl -o /tmp/wkhtmltox.tar.xz $DOWNLOAD_URL && \
cd /tmp && \
tar xf wkhtmltox.tar.xz && \
cp wkhtmltox/bin/wkhtmltopdf /usr/bin && \
cp wkhtmltox/bin/wkhtmltoimage /usr/bin && \
rm wkhtmltox.tar.xz && \
rm -r wkhtmltox
RUN apt-get purge -y curl && \
rm -rf /var/lib/apt/lists/*
COPY /app /usr/src/app
COPY local.conf /etc/fonts/local.conf
RUN chmod -x /etc/fonts/local.conf
RUN fc-cache / usr / share / fonts / release
RUN mkdir /app && \
cd /usr/src/app && \
go build -v -o /app/worker worker.go && \
chown -R appuser:appuser /app
USER appuser
WORKDIR /app
EXPOSE 9090
CMD [ "/app/worker" ]