Skip to content

feat: add Dockerfile, docker-compose, and Docker documentation#17

Open
liuxiaopai-ai wants to merge 1 commit intoibelick:mainfrom
liuxiaopai-ai:feat/docker-support
Open

feat: add Dockerfile, docker-compose, and Docker documentation#17
liuxiaopai-ai wants to merge 1 commit intoibelick:mainfrom
liuxiaopai-ai:feat/docker-support

Conversation

@liuxiaopai-ai
Copy link

Closes #7

What's included

1. Multi-stage Dockerfile

  • Stage 1 (deps): node:22-alpine, installs pnpm via corepack, copies workspace manifests, runs pnpm install --frozen-lockfile
  • Stage 2 (build): Copies source code, runs pnpm build (builds only apps/webclaw via the root script)
  • Stage 3 (runtime): Clean node:22-alpine with only the Nitro .output/ server bundle — minimal image size

2. docker-compose.yml

  • Webclaw service with port mapping 3000:3000
  • Environment variables sourced from .env with sensible defaults
  • restart: unless-stopped policy

3. .dockerignore

  • Excludes node_modules, .git, dist, .output, env files, IDE configs, etc.

4. README update

  • Added a Docker section after the existing Setup section
  • Documents both docker compose up --build and manual docker build/docker run
  • Includes host.docker.internal hint for connecting to a host-side gateway

Key design decisions

  • pnpm workspace-aware: Copies both apps/webclaw/package.json and apps/landing/package.json so workspace resolution succeeds, but only builds webclaw
  • Corepack for pnpm: Uses corepack prepare pnpm@9.15.4 matching the repo's packageManager field
  • Minimal runtime: Final stage contains only the self-contained Nitro server output — no node_modules, no source code
  • Environment variables: CLAWDBOT_GATEWAY_URL, CLAWDBOT_GATEWAY_TOKEN, CLAWDBOT_GATEWAY_PASSWORD configurable at runtime

@ibelick
Copy link
Owner

ibelick commented Feb 9, 2026

@liuxiaopai-ai thanks for the PR. Does the container start and serve the app using only .output (no node_modules) on a fresh docker run?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants