mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
refactor Dockerfile to avoid hardcoded versioning of Playwright
This commit is contained in:
parent
a04610153b
commit
196e0e661d
@ -1,14 +1,42 @@
|
||||
###############################################################################
|
||||
# Dockerfile to create a ready to use Playwright Docker image for end-to-end
|
||||
# testing
|
||||
# Dockerfile to create a ready-to-use Playwright Docker image for end-to-end
|
||||
# testing.
|
||||
#
|
||||
# To avoid hardcoded versoning of Playwright, this Dockerfile is a custom
|
||||
# version of the ready-to-use Dockerfile privided by Playwright developement
|
||||
# (https://github.com/microsoft/playwright/blob/main/utils/docker/Dockerfile.focal)
|
||||
#
|
||||
# Here the latest stable versions of the browsers Chromium, Firefox, and Webkit
|
||||
# (Safari) are installed, icluding all dependencies based on Ubuntu specified by
|
||||
# Playwright developement.
|
||||
###############################################################################
|
||||
ARG PLAYWIRGHT_VERSION=1.23.2
|
||||
|
||||
FROM mcr.microsoft.com/playwright:v$PLAYWIRGHT_VERSION-focal
|
||||
FROM ubuntu:focal
|
||||
|
||||
WORKDIR /tests
|
||||
# set a timezone for the Playwright browser dependency installation
|
||||
ARG TZ=Europe/Berlin
|
||||
|
||||
RUN npm install playwright@$PLAYWIRGHT_VERSION
|
||||
RUN npm install -D @playwright/test
|
||||
ARG DOCKER_WORKDIR=/tests/
|
||||
WORKDIR $DOCKER_WORKDIR
|
||||
|
||||
COPY tests/ /tests
|
||||
# package manager preparation
|
||||
RUN apt-get -qq update && apt-get install -qq -y curl gpg > /dev/null
|
||||
# for Node.js
|
||||
RUN curl -sL https://deb.nodesource.com/setup_16.x | bash -
|
||||
# for Yarn
|
||||
RUN curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
|
||||
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
|
||||
|
||||
# install node v16 and Yarn
|
||||
RUN apt-get -qq update && apt-get install -qq -y nodejs yarn
|
||||
|
||||
COPY tests/package.json tests/yarn.lock $DOCKER_WORKDIR
|
||||
|
||||
# install Playwright with all dependencies
|
||||
# for the browsers chromium, firefox, and webkit
|
||||
RUN yarn install && yarn playwright install --with-deps
|
||||
|
||||
# clean up
|
||||
RUN rm -rf /var/lib/apt/lists/* && apt-get -qq clean
|
||||
|
||||
COPY tests/ $DOCKER_WORKDIR
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user