Skip to content

Commit

Permalink
wkhtmltopdf with qt (#1805)
Browse files Browse the repository at this point in the history
* switch to pre-built image on github with qt support
  • Loading branch information
Sybrand authored Mar 24, 2022
1 parent 5197f38 commit 64c4a9f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 13 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ docker-db:
# Run the database
docker-compose up db

docker-shell-api:
# Shell into the dev container.
docker-compose run --rm api bash

docker-shell-web:
# Shell into the dev container.
# docker run -it --env-file app/.env --entrypoint bash wps-api_api:latest
Expand Down
8 changes: 6 additions & 2 deletions api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,12 @@ RUN R -e "install.packages('cffdrs')"
# Install JDK
RUN apt-get -y install openjdk-11-jdk

# Install pdf-kit for PDF generation on HFI
RUN apt-get -y install wkhtmltopdf
# Install pdf-kit for PDF generation on HFI (with qt support!)
# As of writing, 0.12.6 (the most recent) is the version currently being installed by 3.8.12-buster,
# but without qt. We do a manual instllation of 0.12.6 in order to get qt support.
RUN apt-get update --fix-missing && apt-get -y install xfonts-75dpi xfonts-base
RUN wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.buster_amd64.deb -P /tmp && \
dpkg -i /tmp/wkhtmltox_0.12.6-1.buster_amd64.deb

# Update pip
RUN python -m pip install --upgrade pip
Expand Down
21 changes: 10 additions & 11 deletions openshift/wps-api-base/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,20 @@
# When building local, you can reference the docker image:
FROM tiangolo/uvicorn-gunicorn-fastapi:python3.9

# Install old (2.4.*; current debian) version of gdal and R
RUN apt-get -y update
RUN apt-get -y install libgdal-dev

# Install R
RUN apt-get update --fix-missing && apt-get -y install r-base
# Install pre-requisites
# - old (2.4.*; current debian) version of gdal
# - R (for cffdrs)
# - JDK (for red-app)
# - xfonts-75dpi xfonts-base (for wkhtmltopdf)
RUN apt-get update --fix-missing && apt-get -y install libgdal-dev r-base openjdk-11-jdk xfonts-75dpi xfonts-base

# Install cffdrs
RUN R -e "install.packages('cffdrs')"

# Install JDK
RUN apt-get -y install openjdk-11-jdk

# Install pdf-kit for PDF generation on HFI
RUN apt-get -y install wkhtmltopdf
# Install pdf-kit for PDF generation on HFI (with qt support!)
# We can't just run apt-get -y install wkhtmltopdf, because we don't get qt support.
RUN wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.buster_amd64.deb -P /tmp && \
dpkg -i /tmp/wkhtmltox_0.12.6-1.buster_amd64.deb

# Update pip
RUN python -m pip install --upgrade pip
Expand Down

0 comments on commit 64c4a9f

Please sign in to comment.