snipe/compose.cloud.yml
pyr0ball af1ffa1d94
Some checks are pending
CI / Python tests (push) Waiting to run
CI / Frontend typecheck + tests (push) Waiting to run
Mirror / mirror (push) Waiting to run
feat: wire Search with AI to cf-orch → Ollama (llama3.1:8b)
- Add app/llm/router.py shim — tri-level config lookup:
  repo config/llm.yaml → ~/.config/circuitforge/llm.yaml → env vars
- Add config/llm.cloud.yaml — ollama via cf-orch, llama3.1:8b
- Add config/llm.yaml.example — self-hosted reference config
- compose.cloud.yml: mount llm.cloud.yaml, set CF_ORCH_URL,
  add host.docker.internal:host-gateway (required on Linux Docker)
- api/main.py: use app.llm.router.LLMRouter (shim) not core directly
- .env.example: update LLM section to reference config/llm.yaml.example
- .gitignore: exclude config/llm.yaml (keep example + cloud yaml)

End-to-end tested: 3.2s for "used RTX 3080 under $400, no mining cards"
via cloud container → host.docker.internal:11434 → Ollama llama3.1:8b
2026-04-14 13:23:44 -07:00

57 lines
2.2 KiB
YAML

# Snipe — cloud managed instance
# Project: snipe-cloud (docker compose -f compose.cloud.yml -p snipe-cloud ...)
# Web: http://127.0.0.1:8514 → menagerie.circuitforge.tech/snipe (via Caddy basicauth)
# API: internal only on snipe-cloud-net (no host port — only reachable via nginx)
#
# Usage: ./manage.sh cloud-start | cloud-stop | cloud-restart | cloud-status | cloud-logs | cloud-build
services:
api:
build:
context: ..
dockerfile: snipe/Dockerfile
restart: unless-stopped
env_file: .env
environment:
# Cloud mode — enables per-user DB isolation and Heimdall tier resolution.
# All values may be overridden by setting them in .env (env_file takes precedence
# over environment: only when the same key appears in both — Docker merges them,
# env_file wins for duplicates).
CLOUD_MODE: "true"
CLOUD_DATA_ROOT: /devl/snipe-cloud-data
# DIRECTUS_JWT_SECRET, HEIMDALL_URL, HEIMDALL_ADMIN_TOKEN — set in .env (never commit)
# CF_ORCH_URL routes LLM query builder through cf-orch for VRAM-aware scheduling.
# Override in .env to use a different coordinator URL.
CF_ORCH_URL: "http://host.docker.internal:7700"
extra_hosts:
- "host.docker.internal:host-gateway"
# No network_mode: host — isolated on snipe-cloud-net; nginx reaches it via 'api:8510'
volumes:
- /devl/snipe-cloud-data:/devl/snipe-cloud-data
- ./config/llm.cloud.yaml:/app/snipe/config/llm.yaml:ro
networks:
- snipe-cloud-net
web:
build:
context: .
dockerfile: docker/web/Dockerfile
args:
# Vite bakes these at image build time — changing them requires cloud-build.
# VITE_BASE_URL: app served under /snipe → asset URLs become /snipe/assets/...
# VITE_API_BASE: prepended to all /api/* fetch calls → /snipe/api/search
VITE_BASE_URL: /snipe
VITE_API_BASE: /snipe
restart: unless-stopped
ports:
- "8514:80" # Caddy (caddy-proxy container) reaches via host.docker.internal:8514
volumes:
- ./docker/web/nginx.cloud.conf:/etc/nginx/conf.d/default.conf:ro
networks:
- snipe-cloud-net
depends_on:
- api
networks:
snipe-cloud-net:
driver: bridge