Skip to content

Commit

Permalink
add unoconv, phantom and wkhtmltopdf
Browse files Browse the repository at this point in the history
  • Loading branch information
pofider committed Sep 13, 2021
1 parent de72b52 commit 6866b87
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 14 deletions.
36 changes: 23 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ RUN apt-get update && \
chmod +x phantomjs-1.9.8-linux-x86_64/bin/phantomjs && \
mv phantomjs-1.9.8-linux-x86_64/bin/phantomjs /usr/local/bin/ && \
rm -rf phantomjs* && \
# unoconv - it needs an update of libreoffice on the xenial ubuntu
apt-get -y install unoconv && \
apt-get install -y software-properties-common && \
add-apt-repository ppa:libreoffice/ppa && \
apt-get update && \
apt install -y libreoffice && \
# cleanup
rm -rf /var/lib/apt/lists/* /var/cache/apt/* && \
rm -rf /src/*.deb && \
Expand All @@ -25,11 +31,12 @@ RUN npm install @jsreport/[email protected] \
@jsreport/[email protected] \
@jsreport/[email protected] \
@jsreport/[email protected] \
# [email protected] \
# [email protected] \
# [email protected] \
[email protected] \
# [email protected] \
@jsreport/[email protected] \
@jsreport/[email protected] \
@jsreport/[email protected] \
@jsreport/[email protected] \
[email protected] \
[email protected] \
[email protected]

RUN npm cache clean -f && \
Expand All @@ -38,14 +45,17 @@ RUN npm cache clean -f && \
ENV electron_strategy electron-ipc
ENV phantom_strategy phantom-server

ENV extensions_docxTemplater /app/node_modules/@jsreport/jsreport-docxtemplater
ENV extensions_ejs /app/node_modules/@jsreport/jsreport-ejs
ENV extensions_electronPdf /app/node_modules/@jsreport/jsreport-electron-pdf
ENV extensions_htmlEmbeddedInDocx /app/node_modules/@jsreport/jsreport-html-embedded-in-docx
ENV extensions_htmlToText /app/node_modules/@jsreport/jsreport-html-to-text
ENV extensions_officePassword /app/node_modules/@jsreport/jsreport-office-password
ENV extensions_pug /app/node_modules/@jsreport/jsreport-pug

ENV extensions_docxTemplater /app/packages/jsreport-docxtemplater
ENV extensions_ejs /app/packages/jsreport-ejs
ENV extensions_electronPdf /app/packages/jsreport-electron-pdf
ENV extensions_htmlEmbeddedInDocx /app/packages/jsreport-html-embedded-in-docx
ENV extensions_htmlToText /app/packages/jsreport-html-to-text
ENV extensions_officePassword /app/packages/jsreport-office-password
ENV extensions_pug /app/packages/jsreport-pug
ENV extensions_unoconv /app/packages/jsreport-unoconv
ENV extensions_phantomPdf /app/packages/jsreport-phantom-pdf
ENV extensions_wkhtmltopdf /app/packages/jsreport-wkhtmltopdf
ENV extensions_phantomImage /app/packages/jsreport-phantom-image
ENV DISPLAY :99

USER root
Expand Down
11 changes: 10 additions & 1 deletion Dockerfile.local
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ RUN apt-get update && \
chmod +x phantomjs-1.9.8-linux-x86_64/bin/phantomjs && \
mv phantomjs-1.9.8-linux-x86_64/bin/phantomjs /usr/local/bin/ && \
rm -rf phantomjs* && \
# unoconv - it needs an update of libreoffice on the xenial ubuntu
apt-get -y install unoconv && \
apt-get install -y software-properties-common && \
add-apt-repository ppa:libreoffice/ppa && \
apt-get update && \
apt install -y libreoffice && \
# cleanup
rm -rf /var/lib/apt/lists/* /var/cache/apt/* && \
rm -rf /src/*.deb && \
Expand All @@ -25,7 +31,6 @@ RUN yarn add --ignore-workspace-root-check [email protected] \
RUN yarn cache clean --all && rm -rf /tmp/*

ENV electron_strategy electron-ipc
ENV phantom_strategy phantom-server

# extensions from packages should already be there in the jsreport/worker image
# we just need to define the env var locations for the rest of extensions
Expand All @@ -36,6 +41,10 @@ ENV extensions_htmlEmbeddedInDocx /app/packages/jsreport-html-embedded-in-docx
ENV extensions_htmlToText /app/packages/jsreport-html-to-text
ENV extensions_officePassword /app/packages/jsreport-office-password
ENV extensions_pug /app/packages/jsreport-pug
ENV extensions_unoconv /app/packages/jsreport-unoconv
ENV extensions_phantomPdf /app/packages/jsreport-phantom-pdf
ENV extensions_wkhtmltopdf /app/packages/jsreport-wkhtmltopdf
ENV extensions_phantomImage /app/packages/jsreport-phantom-image

ENV DISPLAY :99

Expand Down

0 comments on commit 6866b87

Please sign in to comment.