-
Notifications
You must be signed in to change notification settings - Fork 141
/
Dockerfile
68 lines (65 loc) · 2.45 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# A minimal Docker image with Node and Puppeteer
# Take care that this is deployed publicly
# https://hub.docker.com/repository/docker/alleywayapps/atat-ci-image
# 20220209d
# Initially based upon:
# https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md#running-puppeteer-in-docker
#
# can't use bullseye because it doesn't have libappindicator (unless installed manually)
FROM node:20.11-buster-slim
WORKDIR /usr/app
RUN apt-get update && apt-get install -y \
fonts-liberation \
gconf-service \
libappindicator1 \
libasound2 \
libatk1.0-0 \
libcairo2 \
libcups2 \
libfontconfig1 \
libgbm-dev \
libgdk-pixbuf2.0-0 \
libgtk-3-0 \
libicu-dev \
libjpeg-dev \
libnspr4 \
libnss3 \
libpango-1.0-0 \
libpangocairo-1.0-0 \
libpng-dev \
libx11-6 \
libx11-xcb1 \
libxcb1 \
libxcomposite1 \
libxcursor1 \
libxdamage1 \
libxext6 \
libxfixes3 \
libxi6 \
libxrandr2 \
libxrender1 \
libxss1 \
libxtst6 \
xdg-utils \
fonts-wqy-zenhei \
fonts-noto-color-emoji
RUN npm install npm@10.4.0 -g \
&& apt-get install -y wget gnupg ca-certificates procps dumb-init \
# We install Chrome to get all the OS level dependencies, but Chrome itself
# is not actually used as it's packaged in the node puppeteer library.
# Alternatively, we could could include the entire dep list ourselves
# (https://github.com/puppeteer/puppeteer/blob/master/docs/troubleshooting.md#chrome-headless-doesnt-launch-on-unix)
# but that seems too easy to get out of date. \
# && wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
# && sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
# && apt-get update \
# && apt-get install -y git \
# && apt-get install -y google-chrome-stable=98.0.4758.80-1 \
# && apt-get install -y traceroute \
# && rm -rf /var/lib/apt/lists/* \
# && 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 \
# Install Puppeteer under /node_modules so it's available system-wide
&& npm install -g puppeteer@22.2.0 --unsafe-perm=true
# be sure that the version of puppeteer matches the version of google-chrome-stable, otherwise possible high CPU
ENTRYPOINT ["/usr/bin/dumb-init", "--"]