# Overlay for the isolated browser suite. Only deploy/scripts/e2e.sh combines # it with docker-compose.yml, under a unique project name and a generated # throwaway env file; never apply it to the working stand. services: frontend: # The browser shares this container's network namespace, so the stand # publishes no host port and cannot collide with a running stand. ports: !reset [] playwright: # The tag must match @playwright/test in frontend/package.json; the runner # reads the version from there. image: mcr.microsoft.com/playwright:v${PLAYWRIGHT_VERSION:?Set PLAYWRIGHT_VERSION}-noble profiles: ["e2e"] # localhost:8080 inside this namespace is the frontend Nginx, so the # browser origin equals the loopback APP_PUBLIC_URL the backend accepts. network_mode: service:frontend user: "${E2E_UID:?Set E2E_UID}:${E2E_GID:?Set E2E_GID}" init: true working_dir: /workspace/frontend environment: HOME: /tmp CI: ${E2E_CI:-} E2E_BASE_URL: http://localhost:8080 E2E_ARTIFACTS_DIR: /artifacts # Only the dependencies installed from frontend/pnpm-lock.yaml and the # suite are read; results go to the separate writable mount. volumes: - ../../frontend:/workspace/frontend:ro - ${E2E_SPEC_DIR:?Set E2E_SPEC_DIR}:/workspace/frontend/e2e:ro - ${E2E_ARTIFACTS_DIR:?Set E2E_ARTIFACTS_DIR}:/artifacts command: ["node", "node_modules/@playwright/test/cli.js", "test"] cap_drop: [ALL] security_opt: ["no-new-privileges:true"] shm_size: 1gb deploy: resources: limits: cpus: "2.0" memory: 2G