-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
41 lines (35 loc) · 1.29 KB
/
Dockerfile
File metadata and controls
41 lines (35 loc) · 1.29 KB
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
FROM debian:bookworm-slim
# Install dependencies.
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
ca-certificates=20230311 \
curl=7.88.* \
gpg=2.2.* \
; \
\
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | tee /etc/apt/trusted.gpg.d/nodesource.asc; \
echo 'deb [signed-by=/etc/apt/trusted.gpg.d/nodesource.asc] https://deb.nodesource.com/node_22.x nodistro main' | tee /etc/apt/sources.list.d/nodesource.list; \
\
apt-get update; \
apt-get install -y --no-install-recommends \
nodejs=22.* \
chromium=133.0.* \
; \
\
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
rm -rf /var/lib/apt/lists/*
# Puppeteer.
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
# Install unlighthouse and remove unwanted puppeteer chrome.
RUN --mount=type=cache,target=/root/.npm npm install -g unlighthouse \
&& npm cache clean --force
EXPOSE 5678
# Add user so we don't need --no-sandbox.
RUN addgroup unlighthouse && adduser --ingroup unlighthouse unlighthouse \
&& mkdir -p /home/unlighthouse/Downloads /app \
&& chown -R unlighthouse:unlighthouse /home/unlighthouse \
&& chown -R unlighthouse:unlighthouse /app
USER unlighthouse
WORKDIR /home/unlighthouse