Updates the Playwright Dockerfile to streamline the build process. This change improves the Dockerfile by: - Using `npm ci` for faster and more reliable dependency installation - Copying the .npmrc file before copying the code. - Installing Playwright browsers within the playwright-tests directory.
20 lines
417 B
Docker
20 lines
417 B
Docker
FROM node:20
|
|
|
|
FROM mcr.microsoft.com/playwright:v1.48.0-noble
|
|
|
|
# Set the working directory in the container
|
|
WORKDIR /app
|
|
|
|
ARG NPM_CONFIG_USERCONFIG=/tmp/.npmrc
|
|
|
|
COPY playwright-tests/.npmrc /tmp/.npmrc
|
|
|
|
# Copy the application code
|
|
COPY . .
|
|
|
|
# Install dependencies
|
|
RUN npm ci
|
|
RUN npm --prefix playwright-tests ci
|
|
|
|
# Install Playwright browsers
|
|
RUN npx --prefix playwright-tests playwright install chromium --with-deps
|