-
-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathDockerfile
38 lines (28 loc) · 1.26 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
FROM femtopixel/google-chrome-headless
ARG VERSION=v12.3.0
LABEL maintainer="Jay MOULIN <https://jaymoulin.me/femtopixel/docker-google-lighthouse> <http://twitter.com/MoulinJay>"
LABEL version="${VERSION}"
USER root
# Install deps + add Chrome Stable + purge all the things
RUN rm -rf /var/lib/apt/lists/* && \
apt-get update && \
apt-get remove gnupg -y && apt-get install --reinstall gnupg2 dirmngr --allow-unauthenticated -y && \
apt-get autoclean && apt-get update && apt-get install -y apt-transport-https ca-certificates curl gnupg git --no-install-recommends && \
curl -sSL https://deb.nodesource.com/setup_20.x | bash - && \
apt-get install -y nodejs --no-install-recommends && \
npm --global install npm && \
npm --global install yarn && \
rm -rf /var/lib/apt/lists/* && \
npm install --global lighthouse && \
apt-get purge --auto-remove -y curl gnupg git && \
mkdir -p /home/chrome/reports && chown -R chrome:chrome /home/chrome
# some place we can mount and view lighthouse reports
VOLUME /home/chrome/reports
WORKDIR /home/chrome/reports
COPY entrypoint.sh /usr/bin/entrypoint
# Run Chrome non-privileged
USER chrome
ENV CHROME_FLAGS="--headless --disable-gpu --no-sandbox"
VOLUME /home/chrome/reports
# Drop to cli
ENTRYPOINT ["entrypoint"]