Skip to content

Instantly share code, notes, and snippets.

@leohemsted
Created December 12, 2017 15:52
Show Gist options
  • Save leohemsted/750fd4214fc7258e572a134b1c4598c7 to your computer and use it in GitHub Desktop.
Save leohemsted/750fd4214fc7258e572a134b1c4598c7 to your computer and use it in GitHub Desktop.
Dockerfile that creates a bad PDF
FROM python:3.6-slim-stretch
RUN \
echo "weasyprint dependencies" \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
libcairo2 \
libpango1.0-0 \
libpangocairo-1.0.0 \
libgdk-pixbuf2.0-0 \
shared-mime-info
RUN \
echo "imagemagick dependencies" \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
ghostscript \
imagemagick
RUN pip install weasyprint==0.41
COPY letter.html .
RUN weasyprint letter.html letter.pdf
RUN convert -density 300 -depth 8 -quality 85 letter.pdf letter.png
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment