Cloud mode: attach shared read-only corpus DB (RECIPE_DB_PATH env var)
as "corpus" schema so per-user SQLite DBs can access 3.19M recipes.
All corpus table references now use self._cp prefix ("corpus." in cloud,
"" in local). FTS5 pseudo-column kept unqualified per SQLite spec.
compose.cloud.yml: bind-mount /Library/Assets/kiwi/kiwi.db read-only.
Also fix batch of audit issues:
- #101: OCR approval used source="receipt_ocr" for inventory_items — use "receipt"
- #89/#100: Shopping confirm-purchase used source="shopping_list" — use "manual"
- #103: Frontend inventory filter sent ?status= but API expects ?item_status=
- #104: InventoryItemUpdate schema missing purchase_date field; store.py allowed set also missing it
- #105: Guest cookie Secure flag tied to CLOUD_MODE instead of X-Forwarded-Proto; broke HTTP direct-port access
57 lines
2.1 KiB
YAML
57 lines
2.1 KiB
YAML
# Kiwi — cloud managed instance
|
|
# Project: kiwi-cloud (docker compose -f compose.cloud.yml -p kiwi-cloud ...)
|
|
# Web: http://127.0.0.1:8515 → menagerie.circuitforge.tech/kiwi (via Caddy + JWT auth)
|
|
# API: internal only on kiwi-cloud-net (nginx proxies /api/ → api:8512)
|
|
|
|
services:
|
|
api:
|
|
build:
|
|
context: ..
|
|
dockerfile: kiwi/Dockerfile
|
|
restart: unless-stopped
|
|
env_file: .env
|
|
environment:
|
|
CLOUD_MODE: "true"
|
|
CLOUD_DATA_ROOT: /devl/kiwi-cloud-data
|
|
RECIPE_DB_PATH: /devl/kiwi-corpus/recipes.db
|
|
KIWI_BASE_URL: https://menagerie.circuitforge.tech/kiwi
|
|
# DIRECTUS_JWT_SECRET, HEIMDALL_URL, HEIMDALL_ADMIN_TOKEN — set in .env
|
|
# DEV ONLY: comma-separated IPs that bypass JWT auth (LAN testing without Caddy).
|
|
# Production deployments must NOT set this. Leave blank or omit entirely.
|
|
CLOUD_AUTH_BYPASS_IPS: ${CLOUD_AUTH_BYPASS_IPS:-}
|
|
# cf-orch: route LLM calls through the coordinator for managed GPU inference
|
|
CF_ORCH_URL: http://host.docker.internal:7700
|
|
# Community PostgreSQL — shared across CF products; unset = community features unavailable (fail soft)
|
|
COMMUNITY_DB_URL: ${COMMUNITY_DB_URL:-}
|
|
COMMUNITY_PSEUDONYM_SALT: ${COMMUNITY_PSEUDONYM_SALT:-}
|
|
extra_hosts:
|
|
- "host.docker.internal:host-gateway"
|
|
volumes:
|
|
- /devl/kiwi-cloud-data:/devl/kiwi-cloud-data
|
|
# Recipe corpus — shared read-only NFS-backed SQLite (3.1M recipes, 2.9GB)
|
|
- /Library/Assets/kiwi/kiwi.db:/devl/kiwi-corpus/recipes.db:ro
|
|
# LLM config — shared with other CF products; read-only in container
|
|
- ${HOME}/.config/circuitforge:/root/.config/circuitforge:ro
|
|
networks:
|
|
- kiwi-cloud-net
|
|
|
|
web:
|
|
build:
|
|
context: .
|
|
dockerfile: docker/web/Dockerfile
|
|
args:
|
|
VITE_BASE_URL: /kiwi
|
|
VITE_API_BASE: /kiwi
|
|
restart: unless-stopped
|
|
ports:
|
|
- "8515:80"
|
|
volumes:
|
|
- ./docker/web/nginx.cloud.conf:/etc/nginx/conf.d/default.conf:ro
|
|
networks:
|
|
- kiwi-cloud-net
|
|
depends_on:
|
|
- api
|
|
|
|
networks:
|
|
kiwi-cloud-net:
|
|
driver: bridge
|