Skip to content
Merged
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
16 changes: 6 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,28 +1,24 @@
# docker run -e OPENROUTER_API_KEY="$OPENROUTER_API_KEY" -p 18790:18790 -it --volume="$PWD:/app" --workdir="/app" --entrypoint=/bin/sh clawlet
FROM golang:1.26-alpine AS builder

RUN apk add --no-cache gcc musl-dev

WORKDIR /app

COPY go.mod go.sum ./
RUN go mod download

COPY . .

RUN CGO_ENABLED=1 go build -o clawlet ./cmd/clawlet
RUN CGO_ENABLED=0 go build -o /out/clawlet ./cmd/clawlet

FROM alpine:latest

RUN apk add --no-cache ca-certificates

WORKDIR /app

COPY --from=builder /app/clawlet /usr/local/bin
COPY --from=builder /out/clawlet /usr/local/bin/clawlet

RUN clawlet onboard
RUN clawlet status
# Create config directory
RUN mkdir -p /root/.clawlet

EXPOSE 18790

ENTRYPOINT ["clawlet", "gateway"]
ENTRYPOINT ["clawlet"]
CMD ["status"]
50 changes: 21 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,35 +35,6 @@ clawlet status
clawlet agent -m "What is 2+2?"
```

## Docker

Run clawlet using Docker or Docker Compose instead of installing locally.

### Dockerfile

The Dockerfile uses a multi-stage build: it compiles the Go application with CGO enabled (for sqlite-vec), then runs it in a minimal Alpine container. The container automatically runs `clawlet onboard` and `clawlet status` on first build, then starts the gateway.

### Docker Compose

```bash
docker-compose up --build
```

The gateway will be available at `http://localhost:18790`.

### Plain Docker

```bash
# Build the image
docker build -t clawlet .

# Run the gateway
docker run -e OPENROUTER_API_KEY="$OPENROUTER_API_KEY" \
-p 18790:18790 \
-v "$PWD/clawlet.config.json:/root/.clawlet/config.json" \
clawlet
```

## Configuration (`~/.clawlet/config.json`)

Config file: `~/.clawlet/config.json`
Expand Down Expand Up @@ -347,3 +318,24 @@ clawlet cron add --message "remind me" --at "2026-02-10T09:00:00Z"
# Deliver to a chat (requires both --channel and --to)
clawlet cron add --message "ping" --every 600 --channel slack --to U012345
```
## 🐳 Docker

Build and run clawlet in a container:

```bash
# Build the image
docker build -t clawlet .

# Initialize config (first time only)
docker run -v ~/.clawlet:/root/.clawlet --rm clawlet onboard

# Edit config on host to add API keys
vim ~/.clawlet/config.json

# Run the gateway
docker run -v ~/.clawlet:/root/.clawlet -p 18790:18790 clawlet gateway

# Or run a single command
docker run -v ~/.clawlet:/root/.clawlet --rm clawlet agent -m "Hello"
docker run -v ~/.clawlet:/root/.clawlet --rm clawlet status
```
109 changes: 0 additions & 109 deletions clawlet.config.json

This file was deleted.

18 changes: 0 additions & 18 deletions docker-compose.yml

This file was deleted.