Skip to content

Instantly share code, notes, and snippets.

@ehabqadah
Created January 31, 2022 21:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ehabqadah/fec12d4ce94896fd967543336488742f to your computer and use it in GitHub Desktop.
Save ehabqadah/fec12d4ce94896fd967543336488742f to your computer and use it in GitHub Desktop.
PhantomJS with Nodejs on ubuntu (Docker)
FROM ubuntu:latest
WORKDIR /opt/backend
COPY . .
RUN su -
RUN apt-get update
RUN apt-get install sudo -y
RUN sudo apt install curl -y
RUN curl -sL https://deb.nodesource.com/setup_17.x -o nodesource_setup.sh
RUN sudo bash nodesource_setup.sh
RUN sudo apt install nodejs -y
# Reference: https://github.com/Medium/phantomjs#linux-note
RUN sudo apt-get install -y fontconfig
RUN sudo apt-get install -y libfontconfig
RUN sudo npm set strict-ssl false
RUN sudo npm install
RUN sudo npm install -g phantomjs-prebuilt
RUN sudo npm install -g html-pdf
RUN sudo npm rebuild
RUN sudo npm run build
EXPOSE 3005
CMD sudo npm run start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment