forked from GoogleChrome/rendertron
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
81 lines (69 loc) · 2.79 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
69
70
71
72
73
74
75
76
77
78
79
80
FROM node:18-bullseye-slim
# Install latest chrome dev package and fonts to support major charsets (Chinese, Japanese, Arabic, Hebrew, Thai and a few others)
# Note: this installs the necessary libs to make the bundled version of Chromium that Puppeteer
# installs, work.
RUN apt-get update && \
apt-get install -y wget gnupg && \
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 \
wget \
gnupg \
libxshmfence1 \
libglu1 \
fonts-ipafont-gothic \
fonts-wqy-zenhei \
fonts-thai-tlwg \
fonts-kacst \
fonts-freefont-ttf \
libxss1 \
libxtst6 \
ca-certificates \
fonts-liberation \
libasound2 \
libatk-bridge2.0-0 \
libcairo2 \
libcups2 \
libcurl3-gnutls \
libcurl3-nss \
libcurl4 \
libgbm1 \
libgtk-3-0 \
libnspr4 \
libnss3 \
libpango-1.0-0 \
libwayland-client0 \
libxcomposite1 \
libxkbcommon0 \
libxrandr2 \
xdg-utils \
--no-install-recommends \
&& rm -rf /var/lib/apt/lists/*
# https://stackoverflow.com/questions/75251315/dependency-issue-installing-google-chrome-stable-through-ubuntu-docker
RUN wget --no-check-certificate --no-verbose http://archive.ubuntu.com/ubuntu/pool/main/libu/libu2f-host/libu2f-udev_1.1.4-1_all.deb \
&& apt update \
&& apt install -y ./libu2f-udev_1.1.4-1_all.deb \
&& rm ./libu2f-udev_1.1.4-1_all.deb
# WORKAROUND: https://github.com/CircleCI-Public/browser-tools-orb/issues/75#issuecomment-1640923560
ARG CHROME_VERSION="125.0.6422.141-1"
RUN wget --no-check-certificate --no-verbose -O /tmp/chrome.deb https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_${CHROME_VERSION}_amd64.deb \
&& apt install -y /tmp/chrome.deb \
&& rm /tmp/chrome.deb
# If running Docker >= 1.13.0 use docker run's --init arg to reap zombie processes, otherwise
# uncomment the following lines to have `dumb-init` as PID 1
# ADD https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64 /usr/local/bin/dumb-init
# RUN chmod +x /usr/local/bin/dumb-init
# ENTRYPOINT ["dumb-init", "--"]
# Uncomment to skip the chromium download when installing puppeteer. If you do,
# you'll need to launch puppeteer with:
# browser.launch({executablePath: 'google-chrome-stable'})
# ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true
WORKDIR /rendertron
COPY package*.json /rendertron/
RUN npm install
ENV SENTRY_AUTH_TOKEN=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
COPY . /rendertron
RUN npm run build
ENV NODE_ENV production
CMD ["npm", "run", "start"]