mirror of
https://github.com/different-ai/openwork
synced 2026-04-25 17:15:34 +02:00
Add docker-compose.dev.yml using off-the-shelf node:22-bookworm-slim image that starts headless + web UI with auto-wired tokens and health checks. Builds Linux binaries into /tmp to avoid overwriting host macOS binaries.
OpenWork Host (Docker)
Dev testability stack (recommended for testing)
One command, no custom Dockerfile. Uses node:22-bookworm-slim off the shelf.
From the repo root:
docker compose -f packaging/docker/docker-compose.dev.yml up
Then open http://localhost:5173 — the web UI is already wired to headless.
What it does:
- Starts headless (OpenCode + OpenWork server) on port 8787
- Starts web UI (Vite dev server) on port 5173
- Auto-generates and shares auth tokens between services
- Web waits for headless health check before starting
- Builds Linux binaries inside the container (no host binary conflicts)
Useful commands:
- Logs:
docker compose -f packaging/docker/docker-compose.dev.yml logs - Tear down:
docker compose -f packaging/docker/docker-compose.dev.yml down - Health check:
curl http://localhost:8787/health
Optional env vars (via .env or export):
OPENWORK_TOKEN— fixed client tokenOPENWORK_HOST_TOKEN— fixed host/admin tokenOPENWORK_WORKSPACE— host path to mount as workspace
Production container
This is a minimal packaging template to run the OpenWork Host contract in a single container.
It runs:
opencode serve(engine) bound to127.0.0.1:4096inside the containeropenwork-serverbound to0.0.0.0:8787(the only published surface)
Local run (compose)
From this directory:
docker compose up --build
Then open:
http://127.0.0.1:8787/ui
Config
Recommended env vars:
OPENWORK_TOKEN(client token)OPENWORK_HOST_TOKEN(host/owner token)
Optional:
OPENWORK_APPROVAL_MODE=auto|manualOPENWORK_APPROVAL_TIMEOUT_MS=30000
Persistence:
- Workspace is mounted at
/workspace - Host data dir is mounted at
/data(OpenCode caches + OpenWork server config/tokens)
Notes
- OpenCode is not exposed directly; access it via the OpenWork proxy (
/opencode/*). - For PaaS, replace
./workspace:/workspacewith a volume or a checkout strategy (git clone on boot).