Ensures environment variables defined in the env file are loaded into the Docker containers used for Playwright tests. This is achieved by sourcing the env file within the `docker create` command. Removes the unnecessary CI=true environment variable setting.
18 lines
403 B
Docker
18 lines
403 B
Docker
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
|