Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
node_modules
.git
.gitignore
dist
.output
.env
.env.local
.env.*.local
*.md
!README.md
.vscode
.idea
*.log
.DS_Store
Thumbs.db
47 changes: 47 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# ---- Stage 1: Install dependencies ----
FROM node:22-alpine AS deps

RUN corepack enable && corepack prepare pnpm@9.15.4 --activate

WORKDIR /app

COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
COPY apps/webclaw/package.json ./apps/webclaw/package.json
# Include landing package.json so pnpm workspace resolution succeeds
COPY apps/landing/package.json ./apps/landing/package.json

RUN pnpm install --frozen-lockfile

# ---- Stage 2: Build the app ----
FROM node:22-alpine AS build

RUN corepack enable && corepack prepare pnpm@9.15.4 --activate

WORKDIR /app

COPY --from=deps /app/node_modules ./node_modules
COPY --from=deps /app/apps/webclaw/node_modules ./apps/webclaw/node_modules
COPY --from=deps /app/apps/landing/node_modules ./apps/landing/node_modules

COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
COPY apps/webclaw ./apps/webclaw
COPY apps/landing/package.json ./apps/landing/package.json

RUN pnpm build

# ---- Stage 3: Production runtime ----
FROM node:22-alpine AS runtime

WORKDIR /app

# Copy the Nitro server output (TanStack Start builds to .output/)
COPY --from=build /app/apps/webclaw/.output ./.output

ENV NODE_ENV=production
ENV CLAWDBOT_GATEWAY_URL=ws://host.docker.internal:18789
ENV CLAWDBOT_GATEWAY_TOKEN=
ENV CLAWDBOT_GATEWAY_PASSWORD=

EXPOSE 3000

CMD ["node", ".output/server/index.mjs"]
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,19 @@ Default URL is `ws://127.0.0.1:18789`. Docs: https://docs.openclaw.ai/gateway
pnpm install
pnpm dev
```

## Docker

```bash
# Build and run
docker compose up --build

# Or build manually
docker build -t webclaw .
docker run -p 3000:3000 \
-e CLAWDBOT_GATEWAY_URL=ws://host.docker.internal:18789 \
-e CLAWDBOT_GATEWAY_TOKEN=your_token \
webclaw
```

Note: Use `host.docker.internal` instead of `127.0.0.1` to connect to a gateway running on your host machine.
10 changes: 10 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
services:
webclaw:
build: .
ports:
- "3000:3000"
environment:
- CLAWDBOT_GATEWAY_URL=${CLAWDBOT_GATEWAY_URL:-ws://host.docker.internal:18789}
- CLAWDBOT_GATEWAY_TOKEN=${CLAWDBOT_GATEWAY_TOKEN:-}
- CLAWDBOT_GATEWAY_PASSWORD=${CLAWDBOT_GATEWAY_PASSWORD:-}
restart: unless-stopped