Skip to content

Instantly share code, notes, and snippets.

@scastrec
Last active October 26, 2015 09:00
Show Gist options
  • Save scastrec/2a5afb310630d1a11eba to your computer and use it in GitHub Desktop.
Save scastrec/2a5afb310630d1a11eba to your computer and use it in GitHub Desktop.
Dockerfile for NodeJS + generating PDF with phantom-html2pdf
FROM centos:centos7
# Enable EPEL for Node.js
RUN rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
# Install Node.js and npm
RUN yum install -y npm
# Install bzip2
RUN yum install -y bzip2
# Install lib for phantom
RUN yum install -y freetype
# More deps
RUN yum install -y libXext libXrender fontconfig libfontconfig.so.1
# fonts
RUN yum install -y urw-fonts
# Bundle app source
COPY ./app/ /opt/app
# Install app dependencies
RUN cd /opt/money; ls; npm install /opt/money
COPY ./app/printables /printables
CMD ["node", "/opt/app/src/main.js"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment