513019786e
Move semantic_search_notes off the full-table Python cosine scan onto a native pgvector column: indexed ORDER BY embedding <=> :q LIMIT k (HNSW, cosine). Migration 0067 enables the extension, converts the JSONB embedding column to vector(384) (stale-dim rows dropped and regenerated by the startup backfill), and builds the HNSW cosine index. Postgres image moves postgres:16-alpine -> pgvector/pgvector:pg17 across prod, quickstart, and CI. Scribe: project 2, milestone 93, task 1031. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Xz4j1H7pjYSjKsEpgcNH5E
60 lines
1.8 KiB
YAML
60 lines
1.8 KiB
YAML
# Fabled Scribe — Quick Start
|
|
#
|
|
# No build required. Pulls the latest pre-built image from the registry.
|
|
#
|
|
# Usage:
|
|
# 1. Download this file
|
|
# 2. docker compose -f docker-compose.quickstart.yml up -d
|
|
# 3. Open http://localhost:5000 — the first account registered becomes admin
|
|
# 4. Go to Settings → MCP Access and connect Claude (Code or Desktop) via the
|
|
# bearer-token URL shown there.
|
|
#
|
|
# Set SECRET_KEY via environment variable or a .env file alongside this file:
|
|
# SECRET_KEY=your-random-secret-here
|
|
|
|
services:
|
|
app:
|
|
image: git.fabledsword.com/bvandeusen/fabledscribe:latest
|
|
ports:
|
|
- "5000:5000"
|
|
environment:
|
|
DATABASE_URL: "postgresql+asyncpg://scribe:scribe@db:5432/scribe"
|
|
SECRET_KEY: "${SECRET_KEY:-change-me-in-production}"
|
|
LOG_LEVEL: "${LOG_LEVEL:-INFO}"
|
|
volumes:
|
|
- app_data:/data
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:5000/api/health')"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 30s
|
|
|
|
db:
|
|
# pgvector image (PG17) — bundles the `vector` extension (migration 0067).
|
|
image: pgvector/pgvector:pg17
|
|
stop_grace_period: 120s
|
|
volumes:
|
|
- pgdata:/var/lib/postgresql/data
|
|
environment:
|
|
POSTGRES_USER: scribe
|
|
POSTGRES_PASSWORD: scribe
|
|
POSTGRES_DB: scribe
|
|
# Lenient by design: a transient host exec/healthcheck stall must never
|
|
# escalate to killing the DB. Health here only gates app startup order.
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U scribe"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 10
|
|
start_period: 180s
|
|
restart: unless-stopped
|
|
|
|
volumes:
|
|
app_data:
|
|
pgdata:
|