]>
Commit | Line | Data |
---|---|---|
e325e71d | 1 | # A minimal Docker image with Node and Puppeteer |
162d70f3 | 2 | # |
98ecb0ea TL |
3 | # Based upon: |
4 | # https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md#running-puppeteer-in-docker | |
162d70f3 | 5 | |
782a8c72 RB |
6 | FROM node:10.15.2-slim@sha256:bb63cf8a6b2437f16bad8735a3b162a6c3d3c40eab8db7da7c5c42a7bece92f6 |
7 | ||
98ecb0ea TL |
8 | RUN apt-get update \ |
9 | # See https://crbug.com/795759 | |
10 | && apt-get install -yq libgconf-2-4 \ | |
11 | # Install latest chrome dev package, which installs the necessary libs to | |
12 | # make the bundled version of Chromium that Puppeteer installs work. | |
72d49da3 | 13 | && apt-get install -y wget make --no-install-recommends \ |
98ecb0ea TL |
14 | && wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \ |
15 | && sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \ | |
16 | && apt-get update \ | |
17 | && apt-get install -y google-chrome-unstable --no-install-recommends \ | |
65cd9245 TL |
18 | && rm -rf /var/lib/apt/lists/* \ |
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 | |
f8f84070 | 21 | |
f5311052 PB |
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 | ||
f8f84070 TL |
27 | # Install Puppeteer under /node_modules so it's available system-wide |
28 | ADD package.json package-lock.json / | |
65cd9245 | 29 | RUN npm install |
f5311052 PB |
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 |