Skip to content

Commit 2cdebd5

Browse files
author
Dylan Pinn
committed
Add more config for Puppeteer
1 parent 37d23b7 commit 2cdebd5

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

Diff for: Dockerfile

+20-2
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,37 @@ RUN apt-get update && apt-get install -y curl apt-transport-https && \
1111
# Install latest chrome dev package.
1212
# Note: this installs the necessary libs to make the bundled version of Chromium that Pupppeteer
1313
# installs, work.
14+
RUN apt-get update && apt-get install -yq libgconf-2-4
15+
1416
RUN apt-get update && apt-get install -y wget --no-install-recommends \
1517
&& wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
1618
&& sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
1719
&& apt-get update \
18-
&& apt-get install -y google-chrome-unstable \
19-
--no-install-recommends \
20+
&& apt-get install -y google-chrome-unstable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst ttf-freefont \
21+
--no-install-recommends \
2022
&& rm -rf /var/lib/apt/lists/* \
2123
&& apt-get purge --auto-remove -y curl \
2224
&& rm -rf /src/*.deb
2325

26+
ADD https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64 /usr/local/bin/dumb-init
27+
RUN chmod +x /usr/local/bin/dumb-init
28+
# Install puppeteer so it's available in the container.
29+
RUN npm i puppeteer
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+
2437
# Install AWS CLI
2538
RUN apt-get update && apt-get install -y python-dev python-pip \
2639
&& pip install awscli
2740

2841
WORKDIR /workspace
2942

43+
# Run everything after as non-privileged user.
44+
USER pptruser
45+
46+
ENTRYPOINT ["dumb-init", "--"]
47+
CMD ["google-chrome-unstable"]

0 commit comments

Comments
 (0)