Overview
Docker deployment provides:- Isolated environment - no local Node.js installation required
- Reproducible builds - consistent behavior across systems
- Easy updates - pull new images to upgrade
- Resource limits - control memory and CPU usage
- Multi-container setup - gateway + CLI in separate containers
Quick Start
Using Docker Compose
- Create
docker-compose.yml:
- Create
.envfile:
- Start the gateway:
- Check status:
Building the Image
From Repository
Clone and build:Dockerfile Overview
The Dockerfile:- Base:
node:22-bookworm(Debian 12) - User:
node(uid 1000, non-root) - Installs: Bun, pnpm, project dependencies
- Builds: TypeScript to
dist/, UI toui/dist/ - Optional: Chromium + Xvfb (if
SIMPLECLAW_INSTALL_BROWSER=1) - Exposes: Port 18789 (gateway)
- Command:
node simpleclaw.mjs gateway --allow-unconfigured
Build Arguments
| Argument | Purpose | Example |
|---|---|---|
SIMPLECLAW_INSTALL_BROWSER | Install Chromium + Xvfb | --build-arg SIMPLECLAW_INSTALL_BROWSER=1 |
SIMPLECLAW_DOCKER_APT_PACKAGES | Additional apt packages | --build-arg SIMPLECLAW_DOCKER_APT_PACKAGES="vim curl" |
Running Containers
Gateway Container
Run the gateway:CLI Container
Run CLI commands:Interactive Shell
Drop into a shell:Configuration
Volume Mounts
Mount these directories:Environment Variables
Pass via-e or .env file:
Network Mode
Bind to specific interfaces:Docker Compose Configuration
Full Example
Environment File
Create.env:
Run CLI Commands
Browser Automation
With Chromium Pre-installed
Build with browser:- Installs Chromium via Playwright
- Installs Xvfb for virtual display
- Adds ~300MB to image size
- Eliminates 60-90s install on every container start
Without Pre-installed Browser
Browsers install on first use:Health Checks
Gateway Health
Add health check to Compose:External Health Checks
For platforms requiring external health checks:-
Set gateway token:
-
Bind to LAN:
-
Query health endpoint:
Resource Limits
Memory Limits
CPU Limits
Node.js Heap Size
Security
Non-Root User
The image runs asnode user (uid 1000):
- Prevents privilege escalation
- Reduces attack surface
- Matches standard Node.js Docker practices
Network Isolation
Bind to loopback for internal-only access:Secrets Management
Use Docker secrets or external secret managers:Persistence
Data Directories
Mount volumes for persistence:Backup
Back up mounted directories:Updating
Pull New Image
Rebuild Custom Image
Troubleshooting
Container Won’t Start
Check logs:- Port 18789 already in use
- Missing environment variables
- Volume mount permissions
- Invalid config syntax