Docker
Docker Compose is the recommended way to run Clawbolt. It handles PostgreSQL, migrations, and tunnel setup.
Quick start
Section titled “Quick start”# Clone and configuregit clone https://github.com/mozilla-ai/clawbolt.gitcd clawboltcp .env.example .env# Edit .env with your credentials
# Start everythingdocker compose up --buildWhat Docker Compose starts
Section titled “What Docker Compose starts”| Service | Description |
|---|---|
| db | PostgreSQL 16 database |
| app | FastAPI server on port 8000, with ffmpeg for audio |
| tunnel | Cloudflare Tunnel for HTTPS webhook registration |
On startup, the app:
- Waits for PostgreSQL to be healthy
- Runs Alembic migrations to create/update the schema
- Starts the FastAPI server
- Auto-registers the Telegram webhook via the Cloudflare Tunnel URL
Verify it’s running
Section titled “Verify it’s running”curl http://localhost:8000/api/health# {"status":"ok"}Troubleshooting
Section titled “Troubleshooting”Docker build fails with dependency errors
Section titled “Docker build fails with dependency errors”Some optional dependencies require specific system libraries. The Dockerfile includes ffmpeg for audio processing.
# Rebuild without cachedocker compose build --no-cacheDatabase connection refused
Section titled “Database connection refused”Make sure PostgreSQL is healthy before the app starts. Docker Compose handles this via the service_healthy condition.
# Check service statusdocker compose ps
# View logsdocker compose logs dbdocker compose logs appPort 8000 already in use
Section titled “Port 8000 already in use”# Stop existing containersdocker compose down
# Or use a different portdocker compose up --build -e APP_PORT=8080Reset the database
Section titled “Reset the database”docker compose down -v # removes the pgdata volumedocker compose up --build