89 / 168 · 01 Agent Skills for Browser Automation · CI/CD Integration for AI-Driven Browser Tests← prev⊞ allnext →☰ Read as one page
12.4Docker Configuration
Dockerfile for Test Runner
FROM node:24-slim
# Install Playwright CLI + browsers with system dependencies
RUN npm install -g @playwright/cli@latest \
&& npx playwright install --with-deps chromium
# Copy test scripts
WORKDIR /tests
COPY . .
# Initialize the workspace
RUN playwright-cli install
CMD ["./run-tests.sh", "all"]
(You can also start from Microsoft's official Playwright image — mcr.microsoft.com/playwright:v1.61.0-noble — which ships browsers and dependencies preinstalled.)
docker-compose.yml (with test app)
version: '3.8'
services:
app:
build: ./app
ports:
- "3000:3000"
healthcheck:
test: curl -f http://localhost:3000/health
interval: 5s
timeout: 3s
retries: 5
tests:
build:
context: ./tests
dockerfile: Dockerfile
depends_on:
app:
condition: service_healthy
environment:
- TEST_BASE_URL=http://app:3000
volumes:
- ./test-results:/tests/failures