Skip to content

Building from Source

If you want to build the Docker image from source instead of pulling from ghcr.io:

Clone and build

Terminal window
git clone https://github.com/thisnick/agent-wechat.git
cd agent-wechat
# Auto-detect host architecture
pnpm build:image
# Or specify architecture explicitly
pnpm build:image:arm64 # Apple Silicon
pnpm build:image:amd64 # Intel / AMD

What the build does

The Dockerfile uses a multi-stage build:

  1. Builder stage — compiles the Rust agent-server binary in release mode
  2. Runtime stage — sets up Ubuntu 22.04 with Xvfb, AT-SPI, WeChat, noVNC, ffmpeg, and copies the compiled binary

Development workflow

For active development, you don’t need to rebuild the full image each time:

Terminal window
pnpm install # install dependencies
pnpm build # build CLI + shared types
pnpm dev:deploy # cross-compile Rust & deploy to a running container
pnpm generate-types # regenerate TypeScript types after Rust struct changes