-
-
Notifications
You must be signed in to change notification settings - Fork 604
/
Dockerfile-slim
36 lines (28 loc) · 1.39 KB
/
Dockerfile-slim
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
FROM node:20.9.0-bookworm-slim
ARG TARGETPLATFORM=linux/amd64
ENV SITESPEED_IO_BROWSERTIME__DOCKER=true
ENV SITESPEED_IO_BROWSERTIME__VIDEO=false
ENV SITESPEED_IO_BROWSERTIME__BROWSER=firefox
ENV SITESPEED_IO_BROWSERTIME__VISUAL_METRICS=false
ENV SITESPEED_IO_BROWSERTIME__HEADLESS=true
ENV PATH="/usr/local/bin:${PATH}"
RUN echo "deb http://deb.debian.org/debian/ unstable main contrib non-free" >> /etc/apt/sources.list.d/debian.list && \
apt-get update && \
apt-get install -y --no-install-recommends firefox tcpdump iproute2 ca-certificates sudo --no-install-recommends --no-install-suggests && \
# Cleanup
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
&& rm -rf /var/lib/apt/lists/* /tmp/*
# Install sitespeed.io
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY . /usr/src/app
COPY tools/postinstall.js /usr/src/app/tools/postinstall.js
RUN CHROMEDRIVER_SKIP_DOWNLOAD=true EGDEDRIVER_SKIP_DOWNLOAD=true npm install --production && npm cache clean --force && npm uninstall npm npx -g
WORKDIR /usr/src/app
COPY docker/scripts/start-slim.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' > /etc/sudoers.d/tc
ENTRYPOINT ["bash","/start.sh"]
VOLUME /sitespeed.io
WORKDIR /sitespeed.io