docs(examples): compose for the minimal setup - postgres, real env, no phase notes
This commit is contained in:
@@ -39,14 +39,16 @@ a model or a user has an English default and is overridable
|
||||
## Run
|
||||
|
||||
```sh
|
||||
uv sync # python
|
||||
cd ui && bun install && cd .. # admin + panel SPA, built into ui/build
|
||||
cp examples/config.py /config/config.py
|
||||
DATABASE_URL=postgresql+psycopg://... CONFIG_PATH=/config/config.py uv run beaver-gateway
|
||||
cd examples
|
||||
CLAUDE_CODE_OAUTH_TOKEN=$(claude setup-token) docker compose up --build
|
||||
```
|
||||
|
||||
`examples/config.py` is the smallest setup that starts. The setup's own
|
||||
secrets come from `.env` (`load_dotenv` runs before the config is executed).
|
||||
`examples/config.py` is the smallest setup that starts: one agent, one
|
||||
python tool, one cron job, the built-in frontends on port 8000; the compose
|
||||
file next to it adds Postgres. Without Docker: `uv sync`, build the SPA with
|
||||
`cd ui && bun install && bun run build`, then run `uv run beaver-gateway` with
|
||||
`DATABASE_URL` and `CONFIG_PATH` set. A setup's own secrets come from `.env`
|
||||
next to its config (`load_dotenv` runs before the config is executed).
|
||||
|
||||
## Develop
|
||||
|
||||
|
||||
+27
-22
@@ -1,31 +1,36 @@
|
||||
# Minimal compose for the Phase 0 DoD: build the image, mount a
|
||||
# single-file user config, watch the process print its summary line
|
||||
# and exit cleanly.
|
||||
#
|
||||
# Real deployments add a postgres service, raycast-config.json bind,
|
||||
# ~/.config/claude bind, etc. — Phase 5 lives in a separate example
|
||||
# repo (see PLAN §5.1).
|
||||
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:16-alpine
|
||||
environment:
|
||||
POSTGRES_USER: beaver
|
||||
POSTGRES_PASSWORD: beaver
|
||||
POSTGRES_DB: beaver
|
||||
volumes:
|
||||
- postgres-data:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U beaver -d beaver"]
|
||||
interval: 5s
|
||||
timeout: 3s
|
||||
retries: 20
|
||||
|
||||
gateway:
|
||||
build:
|
||||
context: ..
|
||||
dockerfile: Dockerfile
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
environment:
|
||||
DATABASE_URL: "sqlite:///./gateway.db"
|
||||
ADMIN_USER: "admin"
|
||||
ADMIN_PASS: "change-me"
|
||||
SESSION_SECRET: "dev-secret-change-me"
|
||||
# Phase 1.4 — comma-separated `name:value` pairs. The frontend
|
||||
# 401s every request until at least one token is set.
|
||||
BOOTSTRAP_TOKENS: "cursor:dev-token-change-me"
|
||||
# RAYCAST_BEARER / RAYCAST_DEVICE_ID + a raycast.json bind go
|
||||
# here once you wire up an actual RaycastAgent. The example
|
||||
# config.py declares one, so set these (or remove the agent)
|
||||
# before exposing port 8000.
|
||||
CONFIG_PATH: /config/config.py
|
||||
DATABASE_URL: postgresql+psycopg://beaver:beaver@postgres:5432/beaver
|
||||
ADMIN_USER: admin
|
||||
ADMIN_PASS: change-me
|
||||
SESSION_SECRET: change-me-too
|
||||
BOOTSTRAP_TOKENS: dev:change-me:*
|
||||
CLAUDE_CODE_OAUTH_TOKEN: ${CLAUDE_CODE_OAUTH_TOKEN}
|
||||
ports:
|
||||
# The one gateway port: /anthropic, /mcp, /admin, /md under it
|
||||
# (change ADMIN_USER/ADMIN_PASS/SESSION_SECRET before exposing).
|
||||
- "8000:8000"
|
||||
volumes:
|
||||
- ./config.py:/config/config.py:ro
|
||||
|
||||
volumes:
|
||||
postgres-data:
|
||||
|
||||
Reference in New Issue
Block a user