Skip to content

Commit

Permalink
don't download chrome twice. Use the system installed one
Browse files Browse the repository at this point in the history
  • Loading branch information
paulrbr-fl committed Feb 8, 2019
1 parent 72d49da commit f531105
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md#running-puppeteer-in-docker

FROM node:10.15.1-slim@sha256:f584009b47eb352e7ae0a550fb9394533dc9b80f7aa83d50ef81657358412d0e

RUN apt-get update \
# See https://crbug.com/795759
&& apt-get install -yq libgconf-2-4 \
Expand All @@ -19,6 +19,20 @@ RUN apt-get update \
&& wget --quiet https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh -O /usr/sbin/wait-for-it.sh \
&& chmod +x /usr/sbin/wait-for-it.sh

# Tell Puppeteer to skip installing Chrome. We'll be using the installed package.
# you'll need to launch puppeteer with:
# browser.launch({executablePath: 'google-chrome-unstable'})
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true

# Install Puppeteer under /node_modules so it's available system-wide
ADD package.json package-lock.json /
RUN npm install

# Add user so we don't need --no-sandbox.
RUN groupadd -r pptruser && useradd -r -g pptruser -G audio,video pptruser \
&& mkdir -p /home/pptruser/Downloads \
&& chown -R pptruser:pptruser /home/pptruser \
&& chown -R pptruser:pptruser /node_modules

# Run everything after as non-privileged user.
USER pptruser

0 comments on commit f531105

Please sign in to comment.