Created
January 31, 2022 21:49
-
-
Save ehabqadah/fec12d4ce94896fd967543336488742f to your computer and use it in GitHub Desktop.
PhantomJS with Nodejs on ubuntu (Docker)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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