diff --git a/DOCUMENTATION/content/documentation/index.md b/DOCUMENTATION/content/documentation/index.md index 42eb5b5b..8bf6247f 100644 --- a/DOCUMENTATION/content/documentation/index.md +++ b/DOCUMENTATION/content/documentation/index.md @@ -1956,7 +1956,21 @@ To install FFMPEG in the Workspace container **PS** Don't forget to install the binary in the `php-fpm` container too by applying the same steps above to its container, otherwise the you'll get an error when running the `php-ffmpeg` binary. +
+ +## Install wkhtmltopdf +[wkhtmltopdf](https://wkhtmltopdf.org/) is a utility for outputting a PDF from HTML + +To install wkhtmltopdf in the Workspace container + +1 - Open the `.env` file + +2 - Search for the `WORKSPACE_INSTALL_WKHTMLTOPDF` argument under the Workspace Container and set it to `true` + +3 - Re-build the container `docker-compose build workspace` + +**PS** Don't forget to install the binary in the `php-fpm` container too by applying the same steps above to its container, otherwise the you'll get an error when running the `wkhtmltopdf` binary. diff --git a/docker-compose.yml b/docker-compose.yml index b0b6156c..2a4147cc 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -140,6 +140,7 @@ services: - INSTALL_POWERLINE=${WORKSPACE_INSTALL_POWERLINE} - INSTALL_SUPERVISOR=${WORKSPACE_INSTALL_SUPERVISOR} - INSTALL_FFMPEG=${WORKSPACE_INSTALL_FFMPEG} + - INSTALL_WKHTMLTOPDF=${WORKSPACE_INSTALL_WKHTMLTOPDF} - INSTALL_GNU_PARALLEL=${WORKSPACE_INSTALL_GNU_PARALLEL} - http_proxy - https_proxy @@ -226,6 +227,7 @@ services: - INSTALL_PCNTL=${PHP_FPM_INSTALL_PCNTL} - ADDITIONAL_LOCALES=${PHP_FPM_ADDITIONAL_LOCALES} - INSTALL_FFMPEG=${PHP_FPM_FFMPEG} + - INSTALL_WKHTMLTOPDF=${PHP_FPM_INSTALL_WKHTMLTOPDF} - INSTALL_XHPROF=${PHP_FPM_INSTALL_XHPROF} - PUID=${PHP_FPM_PUID} - PGID=${PHP_FPM_PGID} diff --git a/env-example b/env-example index 24689d79..7fae1d8a 100644 --- a/env-example +++ b/env-example @@ -156,6 +156,7 @@ WORKSPACE_CHROME_DRIVER_VERSION=2.42 WORKSPACE_TIMEZONE=UTC WORKSPACE_SSH_PORT=2222 WORKSPACE_INSTALL_FFMPEG=false +WORKSPACE_INSTALL_WKHTMLTOPDF=false WORKSPACE_INSTALL_GNU_PARALLEL=false WORKSPACE_INSTALL_AST=true WORKSPACE_AST_VERSION=1.0.3 @@ -215,6 +216,7 @@ PHP_FPM_INSTALL_MYSQL_CLIENT=false PHP_FPM_INSTALL_PING=false PHP_FPM_INSTALL_SSHPASS=false PHP_FPM_INSTALL_MAILPARSE=false +PHP_FPM_INSTALL_WKHTMLTOPDF=false PHP_FPM_FFMPEG=false PHP_FPM_ADDITIONAL_LOCALES="es_ES.UTF-8 fr_FR.UTF-8" PHP_FPM_DEFAULT_LOCALE=POSIX diff --git a/php-fpm/Dockerfile b/php-fpm/Dockerfile index b3246ed9..85f30b9c 100644 --- a/php-fpm/Dockerfile +++ b/php-fpm/Dockerfile @@ -849,6 +849,26 @@ RUN if [ ${INSTALL_FFMPEG} = true ]; then \ apt-get -y install ffmpeg \ ;fi +##################################### +# wkhtmltopdf: +##################################### + +USER root + +ARG INSTALL_WKHTMLTOPDF=false + +RUN if [ ${INSTALL_WKHTMLTOPDF} = true ]; then \ + apt-get install -y \ + libxrender1 \ + libfontconfig1 \ + libx11-dev \ + libjpeg62 \ + libxtst6 \ + wget \ + && wget https://github.com/h4cc/wkhtmltopdf-amd64/blob/master/bin/wkhtmltopdf-amd64?raw=true -O /usr/local/bin/wkhtmltopdf \ + && chmod +x /usr/local/bin/wkhtmltopdf \ +;fi + ########################################################################### # Mailparse extension: ########################################################################### diff --git a/workspace/Dockerfile b/workspace/Dockerfile index 267cc16d..07c99ad1 100644 --- a/workspace/Dockerfile +++ b/workspace/Dockerfile @@ -1239,6 +1239,26 @@ RUN if [ ${INSTALL_FFMPEG} = true ]; then \ apt-get -y install ffmpeg \ ;fi +##################################### +# wkhtmltopdf: +##################################### + +USER root + +ARG INSTALL_WKHTMLTOPDF=false + +RUN if [ ${INSTALL_WKHTMLTOPDF} = true ]; then \ + apt-get install -y \ + libxrender1 \ + libfontconfig1 \ + libx11-dev \ + libjpeg62 \ + libxtst6 \ + wget \ + && wget https://github.com/h4cc/wkhtmltopdf-amd64/blob/master/bin/wkhtmltopdf-amd64?raw=true -O /usr/local/bin/wkhtmltopdf \ + && chmod +x /usr/local/bin/wkhtmltopdf \ +;fi + ########################################################################### # Mailparse extension: ###########################################################################