aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorPaul Bonaud <paul.bonaud@fretlink.com>2019-02-08 12:02:19 +0100
committerPaul Bonaud <paul.bonaud@fretlink.com>2019-02-08 12:02:19 +0100
commitf5311052e52ca898602cdae2c61ae1891768283c (patch)
tree2e802fc92f3b66e652b3b333736a02cd729c4876
parent72d49da37ad26422e33444408b3a83c4b5f4cc05 (diff)
downloaddocker-puppeteer-f5311052e52ca898602cdae2c61ae1891768283c.tar.gz
docker-puppeteer-f5311052e52ca898602cdae2c61ae1891768283c.tar.zst
docker-puppeteer-f5311052e52ca898602cdae2c61ae1891768283c.zip
don't download chrome twice. Use the system installed onev1.12.3
-rw-r--r--Dockerfile16
1 files changed, 15 insertions, 1 deletions
diff --git a/Dockerfile b/Dockerfile
index fe9f105..af1e706 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -4,7 +4,7 @@
4# https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md#running-puppeteer-in-docker 4# https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md#running-puppeteer-in-docker
5 5
6FROM node:10.15.1-slim@sha256:f584009b47eb352e7ae0a550fb9394533dc9b80f7aa83d50ef81657358412d0e 6FROM node:10.15.1-slim@sha256:f584009b47eb352e7ae0a550fb9394533dc9b80f7aa83d50ef81657358412d0e
7 7
8RUN apt-get update \ 8RUN apt-get update \
9 # See https://crbug.com/795759 9 # See https://crbug.com/795759
10 && apt-get install -yq libgconf-2-4 \ 10 && apt-get install -yq libgconf-2-4 \
@@ -19,6 +19,20 @@ RUN apt-get update \
19 && wget --quiet https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh -O /usr/sbin/wait-for-it.sh \ 19 && wget --quiet https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh -O /usr/sbin/wait-for-it.sh \
20 && chmod +x /usr/sbin/wait-for-it.sh 20 && chmod +x /usr/sbin/wait-for-it.sh
21 21
22# Tell Puppeteer to skip installing Chrome. We'll be using the installed package.
23# you'll need to launch puppeteer with:
24# browser.launch({executablePath: 'google-chrome-unstable'})
25ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true
26
22# Install Puppeteer under /node_modules so it's available system-wide 27# Install Puppeteer under /node_modules so it's available system-wide
23ADD package.json package-lock.json / 28ADD package.json package-lock.json /
24RUN npm install 29RUN npm install
30
31# Add user so we don't need --no-sandbox.
32RUN groupadd -r pptruser && useradd -r -g pptruser -G audio,video pptruser \
33 && mkdir -p /home/pptruser/Downloads \
34 && chown -R pptruser:pptruser /home/pptruser \
35 && chown -R pptruser:pptruser /node_modules
36
37# Run everything after as non-privileged user.
38USER pptruser