mirror of
https://github.com/microsoft/playwright-mcp.git
synced 2025-07-26 08:32:26 +08:00
22 lines
593 B
Docker
22 lines
593 B
Docker
![]() |
FROM node:22-bookworm-slim
|
||
|
|
||
|
# Set the working directory
|
||
|
WORKDIR /app
|
||
|
|
||
|
# Copy package.json and package-lock.json at this stage to leverage the build cache
|
||
|
COPY package*.json ./
|
||
|
|
||
|
# Install dependencies
|
||
|
RUN npm ci
|
||
|
|
||
|
# Install chromium and its dependencies, but only for headless mode
|
||
|
RUN npx -y playwright install --with-deps --only-shell chromium
|
||
|
|
||
|
# Copy the rest of the app
|
||
|
COPY . .
|
||
|
|
||
|
# Build the app
|
||
|
RUN npm run build
|
||
|
|
||
|
# Run in headless and only with chromium (other browsers need more dependencies not included in this image)
|
||
|
ENTRYPOINT ["node", "cli.js", "--headless", "--browser", "chromium"]
|