Skip to content

runablehq/chromium-template

Repository files navigation

Chrome in Docker with Playwright

This project provides:

  1. A Docker container with Chrome browser accessible via VNC and remote debugging
  2. A TypeScript Playwright script that connects to the remote Chrome instance

Setup

Start the Docker container

# Build and start the container
docker-compose up -d

# Check if the container is running
docker-compose ps

Install Node dependencies

npm install

Running the Playwright script

Make sure the Docker container is running first, then:

npm start

The script will:

  1. Connect to the Chrome browser running in Docker
  2. Navigate to example.com
  3. Take a screenshot
  4. Go to Wikipedia and perform a search
  5. Take another screenshot of the search results

Accessing the Chrome browser directly

All services are accessible through a single port:

Useful commands

# View container logs
docker-compose logs -f

# Stop the container
docker-compose down

# Rebuild and restart the container
docker-compose up -d --build