-
Notifications
You must be signed in to change notification settings - Fork 0
/
dockerfile_lighthouse
40 lines (30 loc) · 1.25 KB
/
dockerfile_lighthouse
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
FROM femtopixel/google-chrome-headless AS FEMTOPIXEL
USER root
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 --no-install-recommends && \
curl -sSL https://deb.nodesource.com/setup_14.x | bash - && \
apt-get install -y nodejs --no-install-recommends && \
npm --global install npm && \
npm --global install yarn && \
apt-get purge --auto-remove -y curl gnupg && \
rm -rf /var/lib/apt/lists/* && \
npm install --global lighthouse && \
mkdir -p /home/chrome/reports && chown -R chrome:chrome /home/chrome
RUN apt-get update || : && \
apt-get install python3 -y && \
apt-get install g++ python3-dev libxml2 libxml2-dev libffi-dev libssl-dev libxslt-dev -y && \
apt-get install python3-pip -y
RUN apt-get install curl -y
COPY requirements.txt requirements.txt
RUN pip3 install --no-cache-dir -r requirements.txt
USER chrome
ENV CHROME_FLAGS="--headless --disable-gpu --no-sandbox"
WORKDIR /home/chrome
COPY src/lighthouse/api.py .
COPY src/lib/constants.py lib/
COPY src/lib/settings.py lib/
CMD python3 api.py