Skip to content

Commit

Permalink
Update Backstop Docker file.
Browse files Browse the repository at this point in the history
  • Loading branch information
10upsimon committed Nov 20, 2024
1 parent 1087cf9 commit 0561d12
Showing 1 changed file with 23 additions and 20 deletions.
43 changes: 23 additions & 20 deletions docker/backstopjs/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,28 +1,31 @@
FROM alpine:3.17
FROM node:16.14.2-bullseye

ARG BACKSTOPJS_VERSION=6.1.1
# Prevent intractive prompts from apt-get.
ARG DEBIAN_FRONTEND=noninteractive

ARG BACKSTOPJS_VERSION=6.1.1
ENV BACKSTOPJS_VERSION=$BACKSTOPJS_VERSION

RUN apk add --no-cache \
chromium \
nss \
freetype \
harfbuzz \
ca-certificates \
ttf-freefont \
nodejs \
npm \
openrc \
dbus

ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser

RUN apk upgrade --no-cache --available && \
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true npm i -g backstopjs@${BACKSTOPJS_VERSION} && \
RUN apt-get update

# Install suggested requirements for running backstop in GitHub actions.
# https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md#running-puppeteer-on-gitlabci
RUN apt-get install -yq gconf-service libasound2 libatk1.0-0 libc6 libcairo2 \
libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgbm1 libgcc1 libgconf-2-4 \
libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 \
libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 \
libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 \
libxss1 libxtst6 ca-certificates fonts-liberation libnss3 lsb-release \
xdg-utils wget

# Install the Chromium requirements, specify a Chromium build for stability.
RUN apt-get install -yq \
chromium=120.0.6099.224-1~deb11u1 \
ca-certificates

RUN PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true npm i -g backstopjs@${BACKSTOPJS_VERSION} && \
npm cache clean -f && \
rm -rf /root/.cache && \
rc-update add dbus
rm -rf /root/.cache

WORKDIR /src

Expand Down

0 comments on commit 0561d12

Please sign in to comment.