Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
P0-1: SaaS relay 模型别名解析 — "glm-4-flash" → "glm-4-flash-250414" (resolve_model)
P0-2: config.rs interpolate_env_vars UTF-8 修复 (chars 迭代器替代 bytes as char)
+ DB 启动编码检查 + docker-compose UTF-8 编码参数
P1-3: UI 模型选择器覆盖 Agent 默认模型 (model_override 全链路: TS→Tauri→Rust kernel)
P1-6: 知识搜索管道修复 — seed_knowledge 创建 chunks + 默认分类 (seed/uploaded/distillation)
P1-7: 用量限额从当前 Plan 读取 (非 stale usage 表)
P1-8: relay 双维度配额检查 (relay_requests + input_tokens)
P2-9: SSE 路径 token 计数修复 — 流结束检测替代固定 500ms sleep + billing increment
79 lines
1.9 KiB
YAML
79 lines
1.9 KiB
YAML
# ============================================================
|
|
# ZCLAW SaaS Backend - Docker Compose
|
|
# ============================================================
|
|
# Usage:
|
|
# cp saas-env.example .env # then edit .env with real values
|
|
# docker compose up -d
|
|
# docker compose logs -f saas
|
|
# ============================================================
|
|
|
|
services:
|
|
# ---- PostgreSQL 16 ----
|
|
postgres:
|
|
image: pgvector/pgvector:pg16
|
|
container_name: zclaw-postgres
|
|
restart: unless-stopped
|
|
|
|
environment:
|
|
POSTGRES_USER: ${POSTGRES_USER:-postgres}
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-your_secure_password}
|
|
POSTGRES_DB: ${POSTGRES_DB:-zclaw}
|
|
# 确保 UTF-8 编码 — 中文 Windows 默认 GBK 会导致中文数据损坏
|
|
POSTGRES_INITDB_ARGS: "--encoding=UTF8 --locale=C.UTF-8"
|
|
|
|
ports:
|
|
- "${POSTGRES_PORT:-5432}:5432"
|
|
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres} -d ${POSTGRES_DB:-zclaw}"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
start_period: 10s
|
|
|
|
networks:
|
|
- zclaw-saas
|
|
|
|
# ---- SaaS Backend ----
|
|
saas:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
|
|
container_name: zclaw-saas
|
|
restart: unless-stopped
|
|
|
|
ports:
|
|
- "127.0.0.1:${SAAS_PORT:-8080}:8080"
|
|
|
|
env_file:
|
|
- .env
|
|
|
|
environment:
|
|
DATABASE_URL: postgres://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD:-your_secure_password}@postgres:5432/${POSTGRES_DB:-zclaw}
|
|
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
|
|
interval: 30s
|
|
timeout: 5s
|
|
retries: 3
|
|
start_period: 15s
|
|
|
|
networks:
|
|
- zclaw-saas
|
|
|
|
volumes:
|
|
postgres_data:
|
|
driver: local
|
|
|
|
networks:
|
|
zclaw-saas:
|
|
driver: bridge
|