Skip to content

Commit 9de9e8e

Browse files
authored
Merge pull request laradock#2469 from DGeoWils/master
Added wkhtmltopdf installation to both Workspace and PHP-FPM
2 parents 081e65d + 711b2e7 commit 9de9e8e

5 files changed

Lines changed: 58 additions & 0 deletions

File tree

DOCUMENTATION/content/documentation/index.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1956,7 +1956,21 @@ To install FFMPEG in the Workspace container
19561956
**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.
19571957

19581958

1959+
<br>
1960+
<a name="Install-wkhtmltopdf"></a>
1961+
## Install wkhtmltopdf
1962+
1963+
[wkhtmltopdf](https://wkhtmltopdf.org/) is a utility for outputting a PDF from HTML
1964+
1965+
To install wkhtmltopdf in the Workspace container
1966+
1967+
1 - Open the `.env` file
1968+
1969+
2 - Search for the `WORKSPACE_INSTALL_WKHTMLTOPDF` argument under the Workspace Container and set it to `true`
1970+
1971+
3 - Re-build the container `docker-compose build workspace`
19591972

1973+
**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.
19601974

19611975

19621976

docker-compose.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ services:
140140
- INSTALL_POWERLINE=${WORKSPACE_INSTALL_POWERLINE}
141141
- INSTALL_SUPERVISOR=${WORKSPACE_INSTALL_SUPERVISOR}
142142
- INSTALL_FFMPEG=${WORKSPACE_INSTALL_FFMPEG}
143+
- INSTALL_WKHTMLTOPDF=${WORKSPACE_INSTALL_WKHTMLTOPDF}
143144
- INSTALL_GNU_PARALLEL=${WORKSPACE_INSTALL_GNU_PARALLEL}
144145
- http_proxy
145146
- https_proxy
@@ -226,6 +227,7 @@ services:
226227
- INSTALL_PCNTL=${PHP_FPM_INSTALL_PCNTL}
227228
- ADDITIONAL_LOCALES=${PHP_FPM_ADDITIONAL_LOCALES}
228229
- INSTALL_FFMPEG=${PHP_FPM_FFMPEG}
230+
- INSTALL_WKHTMLTOPDF=${PHP_FPM_INSTALL_WKHTMLTOPDF}
229231
- INSTALL_XHPROF=${PHP_FPM_INSTALL_XHPROF}
230232
- PUID=${PHP_FPM_PUID}
231233
- PGID=${PHP_FPM_PGID}

env-example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ WORKSPACE_CHROME_DRIVER_VERSION=2.42
156156
WORKSPACE_TIMEZONE=UTC
157157
WORKSPACE_SSH_PORT=2222
158158
WORKSPACE_INSTALL_FFMPEG=false
159+
WORKSPACE_INSTALL_WKHTMLTOPDF=false
159160
WORKSPACE_INSTALL_GNU_PARALLEL=false
160161
WORKSPACE_INSTALL_AST=true
161162
WORKSPACE_AST_VERSION=1.0.3
@@ -215,6 +216,7 @@ PHP_FPM_INSTALL_MYSQL_CLIENT=false
215216
PHP_FPM_INSTALL_PING=false
216217
PHP_FPM_INSTALL_SSHPASS=false
217218
PHP_FPM_INSTALL_MAILPARSE=false
219+
PHP_FPM_INSTALL_WKHTMLTOPDF=false
218220
PHP_FPM_FFMPEG=false
219221
PHP_FPM_ADDITIONAL_LOCALES="es_ES.UTF-8 fr_FR.UTF-8"
220222
PHP_FPM_DEFAULT_LOCALE=POSIX

php-fpm/Dockerfile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -849,6 +849,26 @@ RUN if [ ${INSTALL_FFMPEG} = true ]; then \
849849
apt-get -y install ffmpeg \
850850
;fi
851851

852+
#####################################
853+
# wkhtmltopdf:
854+
#####################################
855+
856+
USER root
857+
858+
ARG INSTALL_WKHTMLTOPDF=false
859+
860+
RUN if [ ${INSTALL_WKHTMLTOPDF} = true ]; then \
861+
apt-get install -y \
862+
libxrender1 \
863+
libfontconfig1 \
864+
libx11-dev \
865+
libjpeg62 \
866+
libxtst6 \
867+
wget \
868+
&& wget https://github.com/h4cc/wkhtmltopdf-amd64/blob/master/bin/wkhtmltopdf-amd64?raw=true -O /usr/local/bin/wkhtmltopdf \
869+
&& chmod +x /usr/local/bin/wkhtmltopdf \
870+
;fi
871+
852872
###########################################################################
853873
# Mailparse extension:
854874
###########################################################################

workspace/Dockerfile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1239,6 +1239,26 @@ RUN if [ ${INSTALL_FFMPEG} = true ]; then \
12391239
apt-get -y install ffmpeg \
12401240
;fi
12411241

1242+
#####################################
1243+
# wkhtmltopdf:
1244+
#####################################
1245+
1246+
USER root
1247+
1248+
ARG INSTALL_WKHTMLTOPDF=false
1249+
1250+
RUN if [ ${INSTALL_WKHTMLTOPDF} = true ]; then \
1251+
apt-get install -y \
1252+
libxrender1 \
1253+
libfontconfig1 \
1254+
libx11-dev \
1255+
libjpeg62 \
1256+
libxtst6 \
1257+
wget \
1258+
&& wget https://github.com/h4cc/wkhtmltopdf-amd64/blob/master/bin/wkhtmltopdf-amd64?raw=true -O /usr/local/bin/wkhtmltopdf \
1259+
&& chmod +x /usr/local/bin/wkhtmltopdf \
1260+
;fi
1261+
12421262
###########################################################################
12431263
# Mailparse extension:
12441264
###########################################################################

0 commit comments

Comments
 (0)