Files
claw-code-parity/Dockerfile
Wylabb f7c23fb325
Build Claw Telegram / build (push) Successful in 5m26s
Build Claw Telegram / cleanup (push) Successful in 0s
Replace Rust worker with TS worker in single image
Add ts-worker/ with the Bun/TypeScript worker that replaces
claw-profile-worker. The Dockerfile now builds a single image
containing both the Rust gateway (claw-telegram) and the TS worker.

The image defaults to worker mode (bun run ts-worker/main.ts).
The gateway Unraid XML overrides with --entrypoint claw-telegram.
Worker containers use the same image with the default CMD.

- Add ts-worker/ (12 files): HTTP/SSE server, Anthropic SDK engine,
  approval broker, event translator, state stores
- Add package.json with @anthropic-ai/sdk dependency
- Rewrite Dockerfile: three-stage build (Rust + Bun + runtime)
- Revert CLAW_GATEWAY_WORKER_IMAGE to claw-telegram:latest
- Remove image pull from docker_worker_manager (same image, already local)
- Add ts-worker paths to CI trigger

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 23:44:57 +02:00

48 lines
1.2 KiB
Docker

# Stage 1: Rust build
FROM rust:1.86-bookworm AS rust-builder
WORKDIR /build
COPY rust/ .
RUN cargo build --release --bin claw-telegram
# Stage 2: Bun dependency install
FROM oven/bun:1.3 AS bun-builder
WORKDIR /app
COPY package.json bun.lock* ./
RUN bun install --frozen-lockfile || bun install
# Stage 3: Runtime
FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
curl \
git \
&& rm -rf /var/lib/apt/lists/*
# Bun runtime
COPY --from=oven/bun:1.3 /usr/local/bin/bun /usr/local/bin/bun
# Rust gateway binary
COPY --from=rust-builder /build/target/release/claw-telegram /usr/local/bin/claw-telegram
# Bun dependencies and TS worker source
COPY --from=bun-builder /app/node_modules /app/node_modules
COPY package.json /app/package.json
COPY ts-worker/ /app/ts-worker/
RUN mkdir -p /state/claude-home /state/claw /workspace /data
ENV CLAW_WORKER_BIND_ADDR=0.0.0.0:8080
ENV CLAW_WORKER_STATE_ROOT=/state
ENV CLAW_WORKER_DEFAULT_CWD=/workspace
ENV CLAW_WORKER_MODEL=claude-sonnet-4-6
ENV CLAW_WORKER_PERMISSION_MODE=default
ENV CLAUDE_CONFIG_DIR=/state/claude-home
WORKDIR /app
# Default: worker mode. Gateway overrides via --entrypoint claw-telegram.
CMD ["bun", "run", "ts-worker/main.ts"]