diff options
author | Paul Bonaud <paul.bonaud@fretlink.com> | 2019-02-08 12:02:19 +0100 |
---|---|---|
committer | Paul Bonaud <paul.bonaud@fretlink.com> | 2019-02-08 12:02:19 +0100 |
commit | f5311052e52ca898602cdae2c61ae1891768283c (patch) | |
tree | 2e802fc92f3b66e652b3b333736a02cd729c4876 /Dockerfile | |
parent | 72d49da37ad26422e33444408b3a83c4b5f4cc05 (diff) | |
download | docker-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
Diffstat (limited to 'Dockerfile')
-rw-r--r-- | Dockerfile | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -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 | ||
6 | FROM node:10.15.1-slim@sha256:f584009b47eb352e7ae0a550fb9394533dc9b80f7aa83d50ef81657358412d0e | 6 | FROM node:10.15.1-slim@sha256:f584009b47eb352e7ae0a550fb9394533dc9b80f7aa83d50ef81657358412d0e |
7 | 7 | ||
8 | RUN apt-get update \ | 8 | RUN 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'}) | ||
25 | ENV 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 |
23 | ADD package.json package-lock.json / | 28 | ADD package.json package-lock.json / |
24 | RUN npm install | 29 | RUN npm install |
30 | |||
31 | # Add user so we don't need --no-sandbox. | ||
32 | RUN 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. | ||
38 | USER pptruser | ||