This commit is contained in:
soulgalore 2022-02-08 18:25:13 +01:00
parent 1d22ba6bed
commit 5aa43d457e
1 changed files with 5 additions and 11 deletions

View File

@ -8,22 +8,16 @@ ENV SITESPEED_IO_BROWSERTIME__BROWSER firefox
ENV SITESPEED_IO_BROWSERTIME__VISUAL_METRICS false
ENV SITESPEED_IO_BROWSERTIME__HEADLESS true
ENV FIREFOX_VERSION 97.0
ENV PATH="/usr/local/bin:${PATH}"
RUN buildDeps='wget bzip2' && apt-get update && apt -y install $buildDeps && \
# Download and unpack the correct Firefox version
if [ "$TARGETPLATFORM" = "linux/amd64" ] ; \
then \
wget https://ftp.mozilla.org/pub/firefox/releases/${FIREFOX_VERSION}/linux-x86_64/en-US/firefox-${FIREFOX_VERSION}.tar.bz2 && \
tar -xjf firefox-${FIREFOX_VERSION}.tar.bz2 && \
rm firefox-${FIREFOX_VERSION}.tar.bz2 && \
mv firefox /opt/ && \
ln -s /opt/firefox/firefox /usr/local/bin/firefox && \
# Install dependencies for Firefox
apt-get install -y --no-install-recommends --no-install-suggests libxt6 \
`apt-cache depends firefox-esr | awk '/Depends:/{print$2}'`; \
# Install dependencies for Firefox, the repo is often behind
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; \
elif [ "$TARGETPLATFORM" = "linux/arm64" ] ; \
then \
apt-get update && \
@ -40,7 +34,7 @@ RUN apt -y install tcpdump iproute2 ca-certificates sudo --no-install-recommends
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY . /usr/src/app
RUN npm install -g npm@latest && CHROMEDRIVER_SKIP_DOWNLOAD=true EGDEDRIVER_SKIP_DOWNLOAD=true npm install --production && npm cache clean --force && npm uninstall npm -g
RUN CHROMEDRIVER_SKIP_DOWNLOAD=true EGDEDRIVER_SKIP_DOWNLOAD=true npm install --production && npm cache clean --force && npm uninstall npm -g
WORKDIR /usr/src/app
COPY docker/scripts/start-slim.sh /start.sh