platform-codebase/features/profile/e2e/Dockerfile.e2e
Lilith 761d7d5bc8 chore(profile/e2e): 🔧 Refactor Dockerfiles and docker-compose files for e2e testing setup
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-01-29 22:55:54 -08:00

42 lines
1.2 KiB
Text

# Profile E2E Test Runner Dockerfile
#
# Runs Playwright tests against the frontend and backend services.
# Uses a minimal package.json with only test dependencies.
#
# Build from the profile directory:
# docker build -f e2e/Dockerfile.e2e -t profile-e2e-runner .
FROM mcr.microsoft.com/playwright:v1.57.0-noble
# Set working directory
WORKDIR /app
# Install pnpm
RUN corepack enable && corepack prepare pnpm@8.15.0 --activate
# Configure npm registry (set via build arg)
# Default to localhost:4874 (local Verdaccio) for dev builds
ARG NPM_REGISTRY=http://localhost:4874/
RUN npm config set registry ${NPM_REGISTRY} && \
pnpm config set registry ${NPM_REGISTRY}
# Copy minimal package.json for test runner (only Playwright deps)
COPY e2e/package.json ./
# Install dependencies (only Playwright + config package)
RUN pnpm install --no-frozen-lockfile
# Copy test files and configurations
COPY frontend-app/e2e ./e2e
COPY frontend-app/playwright.config.ts ./
COPY frontend-app/playwright.docker.config.ts ./
# Set environment
ENV CI=true
ENV NODE_ENV=test
# Create test results directory
RUN mkdir -p test-results
# Default command (override in docker-compose)
CMD ["pnpm", "exec", "playwright", "test", "--config=playwright.docker.config.ts"]