Skip to content

Instantly share code, notes, and snippets.

@MohammedEssehemy
Created January 5, 2019 12:01
Show Gist options
  • Save MohammedEssehemy/9f42fd6e25986f0bce349ab597a73bba to your computer and use it in GitHub Desktop.
Save MohammedEssehemy/9f42fd6e25986f0bce349ab597a73bba to your computer and use it in GitHub Desktop.
node with phantomJs #node #phantomjs #docker
# Switch Node images to non-alpine as PhantomJS doesn't run on Alpine
FROM node:10-jessie-slim
LABEL maintainer="Mohammed Essehemy <mohammedessehemy@gmail.com>"
ENV BUILD_PACKAGES="curl build-essential g++ flex bison gperf ruby perl \
libssl-dev libpng-dev libjpeg-dev python \
libx11-dev libxext-dev libsqlite3-dev \
libicu-dev libfreetype6"
ENV RUN_PACKAGES="libfontconfig"
WORKDIR /source
COPY package.json .
RUN apt-get update && apt-get install -y $BUILD_PACKAGES && \
npm install --production && \
npm audit fix && \
npm cache clean --force && \
apt-get remove -y $BUILD_PACKAGES && \
apt-get install -y $RUN_PACKAGES && \
apt-get -y autoremove && apt-get -y autoclean && apt-get clean
ADD ./ .
RUN chown node:node -R /source
USER node
CMD node ./index.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment