From ff50cafe3441d2985b3231103a8fc0bb860ed510 Mon Sep 17 00:00:00 2001 From: luccast <2213102+luccast@users.noreply.github.com> Date: Mon, 26 Jan 2026 16:51:47 -0500 Subject: [PATCH] Add Docker support and GitHub release workflow --- .dockerignore | 7 ++++ .github/workflows/release.yml | 66 +++++++++++++++++++++++++++++++++++ Dockerfile | 24 +++++++++++++ README.md | 43 +++++++++++++---------- docker-compose.yml | 8 +++++ 5 files changed, 130 insertions(+), 18 deletions(-) create mode 100644 .dockerignore create mode 100644 .github/workflows/release.yml create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..1c116e0 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,7 @@ +node_modules +.output +.git +.github +*.md +.env* +.DS_Store diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..4c6bd94 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,66 @@ +name: Release + +on: + release: + types: [published] + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +jobs: + build-and-push: + runs-on: ubuntu-latest + permissions: + contents: write + packages: write + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 22 + cache: npm + + - name: Install dependencies + run: npm ci + + - name: Build + run: npm run build + + - name: Create build artifact + run: | + tar -czvf crabwalk-${{ github.ref_name }}.tar.gz .output + + - name: Upload build to release + uses: softprops/action-gh-release@v1 + with: + files: crabwalk-${{ github.ref_name }}.tar.gz + + - name: Log in to Container Registry + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=raw,value=latest + + - name: Build and push Docker image + uses: docker/build-push-action@v5 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..88e2eeb --- /dev/null +++ b/Dockerfile @@ -0,0 +1,24 @@ +# Build stage +FROM node:22-alpine AS builder + +WORKDIR /app + +COPY package*.json ./ +RUN npm ci + +COPY . . +RUN npm run build + +# Production stage +FROM node:22-alpine AS runner + +WORKDIR /app + +ENV NODE_ENV=production + +COPY --from=builder /app/.output ./.output +COPY --from=builder /app/package.json ./ + +EXPOSE 3000 + +CMD ["node", ".output/server/index.mjs"] diff --git a/README.md b/README.md index c92cab2..a58df87 100644 --- a/README.md +++ b/README.md @@ -16,30 +16,37 @@ Watch your AI agents work across WhatsApp, Telegram, Discord, and Slack in a liv - **Action tracing** - Expand nodes to inspect tool args and payloads - **Session filtering** - Filter by platform, search by recipient -## Getting Started +## Installation + +### Docker (recommended) ```bash +docker run -d \ + -p 3000:3000 \ + -e CLAWDBOT_API_TOKEN=your-token \ + ghcr.io/luccast/crabwalk:latest +``` + +Or with docker-compose: + +```bash +curl -O https://raw.githubusercontent.com/luccast/crabwalk/master/docker-compose.yml +CLAWDBOT_API_TOKEN=your-token docker-compose up -d +``` + +### From source + +```bash +git clone https://github.com/luccast/crabwalk.git +cd crabwalk npm install -npm run dev -``` - -Open `http://localhost:3000/monitor` (or `http://:3000/monitor` for remote access) - -Requires clawdbot gateway running on the same machine. - -## Config - -Token is in `~/.clawdbot/clawdbot.json` - -```bash -# Option 1: command line CLAWDBOT_API_TOKEN=your-token npm run dev - -# Option 2: env file -echo "CLAWDBOT_API_TOKEN=your-token" > .env.local -npm run dev ``` +Open `http://localhost:3000/monitor` + +Requires clawdbot gateway running on the same machine. Token is in `~/.clawdbot/clawdbot.json` + ## Stack TanStack Start, ReactFlow, Framer Motion, tRPC, TanStack DB diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..4160f58 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,8 @@ +services: + crabwalk: + image: ghcr.io/luccast/crabwalk:latest + ports: + - "3000:3000" + environment: + - CLAWDBOT_API_TOKEN=${CLAWDBOT_API_TOKEN} + restart: unless-stopped