Skip to content

Instantly share code, notes, and snippets.

@steren
Created July 4, 2018 00:12
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 steren/dea86dd2352445f926e4d926db709469 to your computer and use it in GitHub Desktop.
Save steren/dea86dd2352445f926e4d926db709469 to your computer and use it in GitHub Desktop.
Headless Chrome Dockerfile
FROM node:8
# Install utilities
RUN apt-get update --fix-missing && apt-get -y upgrade
# Install latest chrome dev package.
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
&& sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
&& apt-get update \
&& apt-get install -y google-chrome-unstable --no-install-recommends \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /src/*.deb
ADD https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64 /usr/local/bin/dumb-init
RUN chmod +x /usr/local/bin/dumb-init
# Start the app
WORKDIR /usr/src/app
COPY package*.json ./
ENV PORT=8080
ENV NODE_ENV=production
RUN npm install --production
COPY . .
EXPOSE 8080
CMD [ "npm", "start" ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment