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
