Files
OmniRoute/docker-compose.yml
Rouzbeh† e3bca29bbc fix(docker): real image tags (bifrost/cliproxyapi) + complete OMNIROUTE_BASE_PATH runtime patcher (#10482)
* fix(docker): real image tags + complete OMNIROUTE_BASE_PATH runtime patcher

Three docker issues fixed:

1. Images that do not exist:
   - bifrost: ghcr.io/maximhq/bifrost:1.5.21 never existed (1.5.x tops at
     v1.5.16, all tags carry the v prefix) -> ghcr.io/maximhq/bifrost:v1.6.11
   - cliproxyapi: ghcr.io/router-for-me/* is not publicly pullable (403);
     the official prebuilt image is docker.io/eceasy/cli-proxy-api, where
     the pinned v6.9.7 exists -> docker.io/eceasy/cli-proxy-api:v6.9.7
   - Verified still-current: redis:8.6.5-alpine (already on Redis 8 since
     #9065; ioredis 5.10 is RESP2/3-compatible, no modules used) and
     qdrant:v1.12.4 -- both exist, unchanged.

2. OMNIROUTE_BASE_PATH ignored on prebuilt images (root cause):
   Next 16 (webpack and Turbopack) app-router renders SSR asset URLs from
   assetPrefix ALONE; basePath only affects routing. The runtime patcher
   (ensure-docker-base-path) rewrote basePath literals only, so a prebuilt
   root-path image patched to /omniroute served the page but every
   /_next/static shell reference stayed unprefixed (404 behind a subpath
   proxy), the RSC flight-payload chunk refs came from client-reference
   manifests baked with unprefixed paths, and the Turbopack client process
   shim ships an empty env object so the client never learns the subpath.
   Extended patch-standalone-base-path.mjs to also rewrite:
   - assetPrefix literals (mirrors the subpath for SSR asset URLs)
   - the NEXT_PUBLIC_OMNIROUTE_BASE_PATH env mirror in the inline config
   - the client process.env shim (.env={}) with the two basePath keys
   - every baked "/_next/static URL (manifests, media imports, .html pages)
   next.config.mjs now mirrors basePath into assetPrefix so REBUILT images
   bake prefixed assets too. E2E-verified on the published main-web image:
   HTML under /omniroute now has 16/16 prefixed JS srcs and 82/82 prefixed
   flight refs (was 13/9 + ~150 unprefixed), prefixed assets return 200.

* chore(changelog): fragment for #10482 (docker images + basepath patcher)

* chore(changelog): bullet-form fragment for #10482

* Merge branch 'release/v3.8.50' into fix/docker-compose-images-and-basepath

* test(fix): refresh expired alibaba quota sample validity and onnxruntime pin for v3.8.50 base

- alibaba-free-tier-quota-fetcher.test.ts: sample quotaValidityPeriod
  (2026-08-16 16:00 UTC) is in the past, making every quota entry classify
  as expired/not_capable; bump to 2028-01-01 UTC so the text/merge
  classification tests exercise the intended path again.
- optional-transformers-dependency.test.ts: onnxruntime-node pin assertion
  updated from ~1.24.3 to ~1.27.0 to match package.json (bumped by #10403);
  the regular-not-optional intent is unchanged.

---------

Co-authored-by: Rouzbeh <rqzbeh@users.noreply.github.com>
2026-08-17 08:24:27 -03:00

304 lines
12 KiB
YAML

# ──────────────────────────────────────────────────────────────────────
# OmniRoute — Docker Compose
# ──────────────────────────────────────────────────────────────────────
#
# Profiles:
# base → minimal image, no CLI tools
# web → runner-web (+Chromium/Playwright) for web-cookie providers
# cli → CLIs installed inside the container (portable)
# host → runner-base + host-mounted CLI binaries (Linux-first)
# cliproxyapi → CLIProxyAPI sidecar on port 8317
# memory → Qdrant sidecar on port 6333 (semantic memory offload)
# bifrost → Bifrost Go sidecar on port 8080 (Tier-1 LLM router)
#
# Usage:
# docker compose --profile base up -d
# docker compose --profile web up -d # gemini-web / claude-web / claude-turnstile
# docker compose --profile cli up -d
# docker compose --profile host up -d
# docker compose --profile cliproxyapi up -d
# docker compose --profile cli --profile cliproxyapi up -d
# docker compose --profile base --profile memory up -d # adds Qdrant sidecar
# docker compose --profile base --profile bifrost up -d # adds Bifrost sidecar
#
# See docs/architecture/cluster-decisions.md for the per-component rationale
# (Qdrant=opt-in, Bifrost=opt-in, Caddy=upstream LB, no Dragonfly/NATS/PG/Neo4j/MinIO).
#
# Before first run, copy .env.example → .env and edit your secrets.
# ──────────────────────────────────────────────────────────────────────
x-common: &common
restart: unless-stopped
stop_grace_period: 40s
env_file: .env
environment:
- DATA_DIR=/app/data # Must match the volume mount below
- OMNIROUTE_BASE_PATH=${OMNIROUTE_BASE_PATH:-}
- PORT=${PORT:-20128}
- DASHBOARD_PORT=${DASHBOARD_PORT:-20128}
- API_PORT=${API_PORT:-20129}
- API_HOST=${API_HOST:-0.0.0.0}
- LIVE_WS_PORT=${LIVE_WS_PORT:-20132}
- LIVE_WS_HOST=${LIVE_WS_HOST:-0.0.0.0}
- LIVE_WS_ALLOWED_ORIGINS=${LIVE_WS_ALLOWED_ORIGINS:-http://localhost:20128,http://127.0.0.1:20128}
- REDIS_URL=${REDIS_URL:-redis://redis:6379}
- NODE_OPTIONS=--max-old-space-size=2048
volumes:
- ./data:/app/data
healthcheck:
test: ["CMD", "node", "healthcheck.mjs"]
interval: 30s
timeout: 5s
retries: 3
start_period: 15s
services:
# ── Redis (Rate Limiter Backend) ──────────────────────────────────
redis:
image: docker.io/library/redis:8.6.5-alpine
container_name: omniroute-redis
restart: unless-stopped
ports:
# Loopback-only by default: this Redis has no `requirepass`, and the app
# containers reach it over the compose network (redis:6379), so the
# published port exists purely for host-side tooling (redis-cli, a local
# `npm run dev`). A bare "6379:6379" binds 0.0.0.0 — that puts an
# unauthenticated Redis on every LAN interface. Override REDIS_BIND_HOST
# only together with a password (`--requirepass`).
- "${REDIS_BIND_HOST:-127.0.0.1}:${REDIS_PORT:-6379}:6379"
volumes:
- redis-data:/data
command: redis-server --save 60 1 --loglevel warning
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 3
# ── Profile: base (minimal, no CLI tools) ──────────────────────────
omniroute-base:
<<: *common
container_name: omniroute
build:
context: .
target: runner-base
args:
OMNIROUTE_BASE_PATH: ${OMNIROUTE_BASE_PATH:-}
image: omniroute:base
ports:
- "${DASHBOARD_PORT:-20128}:${DASHBOARD_PORT:-20128}"
- "${API_PORT:-20129}:${API_PORT:-20129}"
- "${LIVE_WS_PORT:-20132}:${LIVE_WS_PORT:-20132}"
profiles:
- base
# ── Profile: web (runner-web + Chromium/Playwright) ────────────────
# Required for web-cookie providers (gemini-web, claude-web, claude-turnstile).
# The default `base` image ships without Chromium, so those providers fail
# with "Executable doesn't exist at .../ms-playwright/chromium..." (#2832).
omniroute-web:
<<: *common
container_name: omniroute
build:
context: .
target: runner-web
args:
OMNIROUTE_BASE_PATH: ${OMNIROUTE_BASE_PATH:-}
image: omniroute:web
depends_on:
chatgpt-web-codex-browser:
condition: service_started
environment:
- DATA_DIR=/app/data
- PORT=${PORT:-20128}
- DASHBOARD_PORT=${DASHBOARD_PORT:-20128}
- API_PORT=${API_PORT:-20129}
- API_HOST=${API_HOST:-0.0.0.0}
- LIVE_WS_PORT=${LIVE_WS_PORT:-20132}
- LIVE_WS_HOST=${LIVE_WS_HOST:-0.0.0.0}
- LIVE_WS_ALLOWED_ORIGINS=${LIVE_WS_ALLOWED_ORIGINS:-http://localhost:20128,http://127.0.0.1:20128}
- REDIS_URL=${REDIS_URL:-redis://redis:6379}
- OMNIROUTE_BASE_PATH=${OMNIROUTE_BASE_PATH:-}
- CHATGPT_WEB_CODEX_CDP_URL=http://chatgpt-web-codex-browser:9223
ports:
- "${DASHBOARD_PORT:-20128}:${DASHBOARD_PORT:-20128}"
- "${API_PORT:-20129}:${API_PORT:-20129}"
- "${LIVE_WS_PORT:-20132}:${LIVE_WS_PORT:-20132}"
profiles:
- web
# Internal-only Chromium runtime for ChatGPT Web (Codex). No CDP or browser
# UI port is published to the host.
chatgpt-web-codex-browser:
build:
context: .
dockerfile: docker/chatgpt-web-codex-browser/Dockerfile
image: omniroute:chatgpt-web-codex-browser
restart: unless-stopped
shm_size: "2gb"
volumes:
- chatgpt-web-codex-browser-data:/browser-profile
profiles:
- web
# ── Profile: cli (CLIs installed inside container) ─────────────────
omniroute-cli:
<<: *common
container_name: omniroute
build:
context: .
target: runner-cli
args:
OMNIROUTE_BASE_PATH: ${OMNIROUTE_BASE_PATH:-}
image: omniroute:cli
ports:
- "${DASHBOARD_PORT:-20128}:${DASHBOARD_PORT:-20128}"
- "${API_PORT:-20129}:${API_PORT:-20129}"
- "${LIVE_WS_PORT:-20132}:${LIVE_WS_PORT:-20132}"
volumes:
- ./data:/app/data
- /var/run/docker.sock:/var/run/docker.sock
- /usr/libexec/docker/cli-plugins:/usr/libexec/docker/cli-plugins:ro
- ${AUTO_UPDATE_HOST_REPO_DIR:-.}:/workspace/omniroute:rw
profiles:
- cli
# ── Profile: host (host-mounted CLI binaries, Linux-first) ────────
omniroute-host:
<<: *common
container_name: omniroute
build:
context: .
target: runner-base
args:
OMNIROUTE_BASE_PATH: ${OMNIROUTE_BASE_PATH:-}
image: omniroute:base
ports:
- "${DASHBOARD_PORT:-20128}:${DASHBOARD_PORT:-20128}"
- "${API_PORT:-20129}:${API_PORT:-20129}"
- "${LIVE_WS_PORT:-20132}:${LIVE_WS_PORT:-20132}"
environment:
- DATA_DIR=/app/data
- PORT=${PORT:-20128}
- DASHBOARD_PORT=${DASHBOARD_PORT:-20128}
- API_PORT=${API_PORT:-20129}
- API_HOST=${API_HOST:-0.0.0.0}
- LIVE_WS_PORT=${LIVE_WS_PORT:-20132}
- LIVE_WS_HOST=${LIVE_WS_HOST:-0.0.0.0}
- LIVE_WS_ALLOWED_ORIGINS=${LIVE_WS_ALLOWED_ORIGINS:-http://localhost:20128,http://127.0.0.1:20128}
- CLI_MODE=host
- CLI_EXTRA_PATHS=/host-local/bin:/host-node/bin
- CLI_CONFIG_HOME=/host-home
- CLI_ALLOW_CONFIG_WRITES=true
# Uncomment per-tool overrides as needed:
# - CLI_CURSOR_BIN=agent
# - CLI_CLINE_BIN=cline
# - CLI_CONTINUE_BIN=cn
volumes:
- ./data:/app/data
# ── Host binary mounts (read-only) ──
# Adjust paths below to match YOUR host system.
- ~/.local/bin:/host-local/bin:ro
# Node global binaries (adjust node version path)
# - ~/.nvm/versions/node/v24.14.1/bin:/host-node/bin:ro
# ── Host config mounts (read-write) ──
- ~/.codex:/host-home/.codex:rw
- ~/.claude:/host-home/.claude:rw
- ~/.factory:/host-home/.factory:rw
- ~/.openclaw:/host-home/.openclaw:rw
- ~/.cursor:/host-home/.cursor:rw
- ~/.config/cursor:/host-home/.config/cursor:rw
profiles:
- host
# ── Profile: memory (Qdrant semantic-memory sidecar) ─────────────
# Off by default. SQLite + sqlite-vec + FTS5 (RRF) is the primary vector
# store (see src/lib/memory/vectorStore.ts). Enable only when you need
# cross-instance memory sharing or >1M points — at which point the
# QDRANT_ENABLED=true flag activates the dual-write path in
# src/lib/memory/qdrant.ts:37. See docs/architecture/cluster-decisions.md
# for the workload analysis behind this profile.
qdrant:
image: docker.io/qdrant/qdrant:v1.12.4
container_name: omniroute-qdrant
restart: unless-stopped
ports:
- "${QDRANT_PORT:-6333}:6333"
- "${QDRANT_GRPC_PORT:-6334}:6334"
volumes:
- qdrant-data:/qdrant/storage
environment:
- QDRANT__SERVICE__GRPC_PORT=6334
healthcheck:
test: ["CMD", "wget", "--spider", "-q", "http://127.0.0.1:6333/readyz"]
interval: 15s
timeout: 5s
retries: 3
start_period: 10s
profiles:
- memory
# ── Profile: bifrost (Bifrost Go LLM-router sidecar) ─────────────
# Off by default. Bifrost is the Tier-1 LLM router (per ADR-031 and
# open-sse/executors/bifrost.ts). When BIFROST_ENABLED=true is set in
# .env, OmniRoute delegates /v1/chat/completions, /v1/responses, and
# /v1/embeddings to this sidecar instead of handling them in chatCore.
# The kill switch is the BIFROST_ENABLED env var — flip to false to
# fall back to the chatCore path with zero code changes. See
# docs/architecture/cluster-decisions.md for the activation plan.
bifrost:
image: ghcr.io/maximhq/bifrost:v1.6.11
container_name: omniroute-bifrost
restart: unless-stopped
ports:
- "${BIFROST_PORT:-8080}:8080"
volumes:
- bifrost-data:/data
environment:
- BIFROST_LOG_LEVEL=${BIFROST_LOG_LEVEL:-info}
healthcheck:
test: ["CMD", "wget", "--spider", "-q", "http://127.0.0.1:8080/v1/models"]
interval: 30s
timeout: 5s
retries: 3
start_period: 15s
profiles:
- bifrost
# ── Profile: cliproxyapi (CLIProxyAPI as sidecar) ─────────────────
# Official pre-built image lives on Docker Hub (eceasy/cli-proxy-api);
# ghcr.io/router-for-me/* is not publicly pullable. v6.9.7 is the pinned
# version the sidecar integration (port 8317, /v1/models healthcheck) targets.
cliproxyapi:
container_name: cliproxyapi
image: docker.io/eceasy/cli-proxy-api:v6.9.7
restart: unless-stopped
ports:
- "${CLIPROXYAPI_PORT:-8317}:${CLIPROXYAPI_PORT:-8317}"
volumes:
- cliproxyapi-data:/root/.cli-proxy-api
environment:
- PORT=${CLIPROXYAPI_PORT:-8317}
- HOST=0.0.0.0
healthcheck:
test:
["CMD", "wget", "--spider", "-q", "http://127.0.0.1:${CLIPROXYAPI_PORT:-8317}/v1/models"]
interval: 30s
timeout: 5s
retries: 3
start_period: 10s
profiles:
- cliproxyapi
volumes:
chatgpt-web-codex-browser-data:
name: omniroute-chatgpt-web-codex-browser-data
cliproxyapi-data:
name: cliproxyapi-data
redis-data:
name: omniroute-redis-data
qdrant-data:
name: omniroute-qdrant-data
bifrost-data:
name: omniroute-bifrost-data