-
-
Notifications
You must be signed in to change notification settings - Fork 136
/
Dockerfile
46 lines (32 loc) · 1.52 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
FROM sitespeedio/webbrowsers:chrome-131.0-firefox-131.0-edge-130.0-b
ARG TARGETPLATFORM=linux/amd64
ENV BROWSERTIME_XVFB true
ENV BROWSERTIME_CONNECTIVITY__ENGINE external
ENV BROWSERTIME_DOCKER true
COPY docker/webpagereplay/$TARGETPLATFORM/wpr /usr/local/bin/
COPY docker/webpagereplay/wpr_cert.pem /webpagereplay/certs/
COPY docker/webpagereplay/wpr_key.pem /webpagereplay/certs/
COPY docker/webpagereplay/deterministic.js /webpagereplay/scripts/deterministic.js
COPY docker/webpagereplay/LICENSE /webpagereplay/
RUN sudo apt-get update && DEBIAN_FRONTEND=noninteractive sudo apt-get install libnss3-tools \
net-tools tcpdump -y && \
mkdir -p $HOME/.pki/nssdb && \
certutil -d $HOME/.pki/nssdb -N
ENV PATH="/usr/local/bin:${PATH}"
RUN wpr installroot --https_cert_file /webpagereplay/certs/wpr_cert.pem --https_key_file /webpagereplay/certs/wpr_key.pem
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
VOLUME /browsertime
COPY package.* /usr/src/app/
RUN npm install --production
COPY . /usr/src/app
## This is to avoid click the OK button
RUN mkdir -m 0750 /root/.android
ADD docker/adb/insecure_shared_adbkey /root/.android/adbkey
ADD docker/adb/insecure_shared_adbkey.pub /root/.android/adbkey.pub
WORKDIR /browsertime
COPY docker/scripts/start.sh /start.sh
# Allow all users to run commands needed by sitespeedio/throttle via sudo
# See https://github.com/sitespeedio/throttle/blob/main/lib/tc.js
RUN echo 'ALL ALL=NOPASSWD: /usr/sbin/tc, /usr/sbin/route, /usr/sbin/ip, /usr/sbin/tcpdump ' > /etc/sudoers.d/tc
ENTRYPOINT ["/start.sh"]