# ============================================================================ # RoboCo — pre-built (registry) deployment # ============================================================================ # This is the "pull and run" compose for USERS: it runs the images the release # workflow publishes (GHCR + Docker Hub) instead of building from source, so a # host needs neither the repo's build context nor a build toolchain. # # 1. Copy `.env.example` to `.env` and fill in the required secrets. # 2. docker compose -f docker-compose.registry.yml pull # 3. docker compose -f docker-compose.registry.yml up -d # # Pick the registry + version with two env vars (defaults shown): # ROBOCO_REGISTRY=ghcr.io/rennf93 # or docker.io/renzof93 # ROBOCO_VERSION=latest # or a pinned release, e.g. 0.5.0 # # The orchestrator spawns agent containers itself; ROBOCO_AGENT_IMAGE_REGISTRY # + ROBOCO_AGENT_IMAGE_TAG below tell it to spawn the SAME pre-built agent # images (it pulls any it doesn't already have). The one-shot agent-*-image # services exist only so `docker compose pull` fetches every agent image up # front; they pull then exit. # # NOTE: this file is the registry counterpart of docker-compose.yml — when you # add or change a service there, mirror it here. The infra services # (postgres/redis/ollama/nginx) are byte-identical to the build compose. # # Declared contract — intended deltas from docker-compose.yml (check drift # against THIS list, not against the build compose directly): # - Image source: every roboco-built service pulls `image:` from # ROBOCO_REGISTRY/ROBOCO_VERSION instead of `build:`-ing from source. # - Agent image pre-pull one-shots + ROBOCO_AGENT_IMAGE_REGISTRY/_TAG exist # only here — the build compose builds agent images on demand instead. # - Feature-flag posture: every default-OFF subsystem is carried here at # its OFF/config default (never omitted — an omitted var can't be armed # via .env without hand-editing this file) so the published default # stays conservative; the build compose arms most of them ON for the # personal NAS deploy. ROBOCO_ROUTING_STRICT and the fastapi-guard trio # (ROBOCO_GUARD_ENABLED/_PASSIVE_MODE/_FAIL_SECURE) are the exception: # both are still mid-calibration on the personal deploy, so they're # omitted entirely here rather than carried — their config defaults # (graceful-degrade routing, guard off) are already the safe posture. # - Host path defaults differ (/opt/roboco vs /volume1/roboco, ${HOME} # instead of a hardcoded /home/renzof) — registry targets a generic host. # - MinIO (object storage for rendered videos) is intentionally omitted — # NAS default-on, registry default-off (see the comment near the # orchestrator's MinIO env block below and docs/rag/architecture/ # minio-storage.md). No consumer requires it; the media route falls # back to local-disk FileResponse when unconfigured. # - The video-renders bind mount is commented out here (video engine ships # OFF); uncomment alongside ROBOCO_VIDEO_ENGINE_ENABLED=true. # ============================================================================ services: postgres: image: pgvector/pgvector:pg16 container_name: roboco-postgres restart: unless-stopped # data-only network: agent containers (on roboco_default) cannot reach # the production DB; only the multi-homed orchestrator can. Host port # publishing (15432) is unaffected — roboco_data is a normal bridge. networks: - data environment: POSTGRES_USER: roboco POSTGRES_PASSWORD: roboco POSTGRES_DB: roboco ports: - "15432:5432" volumes: - ${ROBOCO_DATA_DIR:-./data}/postgres:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U roboco -d roboco"] interval: 10s timeout: 5s retries: 5 redis: image: redis:8-alpine container_name: roboco-redis restart: unless-stopped # data-only network — see postgres. Redis has no auth, so network # membership is its ONLY containment against agent containers. networks: - data command: redis-server --appendonly yes ports: - "16379:6379" volumes: - ${ROBOCO_DATA_DIR:-./data}/redis:/data healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 10s timeout: 5s retries: 5 # -------------------------------------------------------------------------- # Backup - periodic pg_dump of the roboco DB (interim; no PITR/WAL yet) # -------------------------------------------------------------------------- backup: image: pgvector/pgvector:pg16 container_name: roboco-backup restart: unless-stopped # data-only network — pg_dump reaches postgres by container name, same # as every other data-network consumer; never exposed to the agent mesh. networks: - data environment: POSTGRES_HOST: roboco-postgres POSTGRES_PORT: 5432 POSTGRES_USER: roboco POSTGRES_PASSWORD: roboco POSTGRES_DB: roboco entrypoint: ["/bin/bash", "/scripts/backup-entrypoint.sh"] volumes: - ./docker/scripts/backup-entrypoint.sh:/scripts/backup-entrypoint.sh:ro - ${ROBOCO_DATA_DIR:-./data}/backups:/backups depends_on: postgres: condition: service_healthy ollama: image: ollama/ollama:latest container_name: roboco-ollama restart: unless-stopped environment: OLLAMA_API_KEY: ${OLLAMA_API_KEY:-} ports: - "11435:11434" volumes: - ${ROBOCO_DATA_DIR:-./data}/ollama:/root/.ollama healthcheck: test: ["CMD", "ollama", "list"] interval: 10s timeout: 5s retries: 5 start_period: 10s ollama-init: image: curlimages/curl:latest container_name: roboco-ollama-init depends_on: ollama: condition: service_healthy restart: "no" entrypoint: ["/bin/sh", "-c"] command: - | # NO `set -e`: pulls are best-effort. Cached models persist in the ollama # volume and MUST survive a slow/unreachable ollama registry — a manifest # re-check failure there must never down a fully-cached deployment (it # used to: a degraded registry made `ollama pull` fail under set -e, which # blocked the orchestrator's service_completed_successfully gate). Success # is gated on the models being PRESENT (verify step), not on the pull. # Note: $$ escapes $ for docker-compose variable substitution. echo "=== Pulling embedding model (qwen3-embedding:0.6b) — best-effort ===" curl -sN http://ollama:11434/api/pull -d '{"name":"qwen3-embedding:0.6b"}' | while read -r line; do status=$$(echo "$$line" | grep -o '"status":"[^"]*"' | cut -d'"' -f4) [ -n "$$status" ] && echo " $$status" done || echo " (pull failed — relying on the cached model)" echo "=== Pulling LLM model (glm-5.2:cloud) — best-effort ===" curl -sN http://ollama:11434/api/pull -d '{"name":"glm-5.2:cloud"}' | while read -r line; do status=$$(echo "$$line" | grep -o '"status":"[^"]*"' | cut -d'"' -f4) [ -n "$$status" ] && echo " $$status" done || echo " (pull failed — relying on the cached model)" echo "=== Verifying models are present (the real success gate) ===" curl -sf http://ollama:11434/api/tags | grep -q "qwen3-embedding" || { echo "FATAL: qwen3-embedding missing and could not be pulled"; exit 1; } curl -sf http://ollama:11434/api/tags | grep -q "glm-5.2" || { echo "FATAL: glm-5.2 missing and could not be pulled"; exit 1; } echo "=== All models ready! ===" # -------------------------------------------------------------------------- # Video Renderer - sidecar for the video-generation engine (renders # motion/ compositions to MP4 with HyperFrames). Harmless when idle — it # only renders when POSTed; the video_engine_* feature flags (off by # default in this compose) gate whether the orchestrator ever sends it # work. No DB access, no git, no credentials. # -------------------------------------------------------------------------- video-renderer: image: ${ROBOCO_REGISTRY:-ghcr.io/rennf93}/roboco-video-renderer:${ROBOCO_VERSION:-latest} container_name: roboco-video-renderer restart: unless-stopped # Isolated sidecar network: headless Chrome here executes # agent-authored composition HTML/JS. Only the orchestrator (also # homed on `render`) can reach it; it can reach nothing else. networks: - render # Chrome headless rendering can crash under Docker's default 64MB # /dev/shm ("Chrome crashed"); give it real shared memory. shm_size: "1gb" mem_limit: "2g" cpus: 2 healthcheck: test: ["CMD", "node", "-e", "fetch('http://127.0.0.1:3001/health').then((r) => process.exit(r.ok ? 0 : 1)).catch(() => process.exit(1))"] interval: 10s timeout: 5s retries: 5 start_period: 10s # -------------------------------------------------------------------------- # Agent image pre-pull (one-shot). Each pulls its published image then exits, # so `docker compose pull` fetches every agent image up front. The # orchestrator spawns these same images at runtime. # -------------------------------------------------------------------------- agent-base-image: image: ${ROBOCO_REGISTRY:-ghcr.io/rennf93}/roboco-agent-base:${ROBOCO_VERSION:-latest} entrypoint: ["/bin/sh", "-c", "echo 'agent-base image present'"] restart: "no" agent-pm-image: image: ${ROBOCO_REGISTRY:-ghcr.io/rennf93}/roboco-agent-pm:${ROBOCO_VERSION:-latest} entrypoint: ["/bin/sh", "-c", "echo 'agent-pm image present'"] restart: "no" agent-dev-be-image: image: ${ROBOCO_REGISTRY:-ghcr.io/rennf93}/roboco-agent-dev-be:${ROBOCO_VERSION:-latest} entrypoint: ["/bin/sh", "-c", "echo 'agent-dev-be image present'"] restart: "no" agent-dev-fe-image: image: ${ROBOCO_REGISTRY:-ghcr.io/rennf93}/roboco-agent-dev-fe:${ROBOCO_VERSION:-latest} entrypoint: ["/bin/sh", "-c", "echo 'agent-dev-fe image present'"] restart: "no" agent-qa-be-image: image: ${ROBOCO_REGISTRY:-ghcr.io/rennf93}/roboco-agent-qa-be:${ROBOCO_VERSION:-latest} entrypoint: ["/bin/sh", "-c", "echo 'agent-qa-be image present'"] restart: "no" agent-qa-fe-image: image: ${ROBOCO_REGISTRY:-ghcr.io/rennf93}/roboco-agent-qa-fe:${ROBOCO_VERSION:-latest} entrypoint: ["/bin/sh", "-c", "echo 'agent-qa-fe image present'"] restart: "no" agent-ux-image: image: ${ROBOCO_REGISTRY:-ghcr.io/rennf93}/roboco-agent-ux:${ROBOCO_VERSION:-latest} entrypoint: ["/bin/sh", "-c", "echo 'agent-ux image present'"] restart: "no" agent-doc-image: image: ${ROBOCO_REGISTRY:-ghcr.io/rennf93}/roboco-agent-doc:${ROBOCO_VERSION:-latest} entrypoint: ["/bin/sh", "-c", "echo 'agent-doc image present'"] restart: "no" agent-prompter-image: image: ${ROBOCO_REGISTRY:-ghcr.io/rennf93}/roboco-agent-prompter:${ROBOCO_VERSION:-latest} entrypoint: ["/bin/sh", "-c", "echo 'agent-prompter image present'"] restart: "no" agent-secretary-image: image: ${ROBOCO_REGISTRY:-ghcr.io/rennf93}/roboco-agent-secretary:${ROBOCO_VERSION:-latest} entrypoint: ["/bin/sh", "-c", "echo 'agent-secretary image present'"] restart: "no" agent-pr-reviewer-image: image: ${ROBOCO_REGISTRY:-ghcr.io/rennf93}/roboco-agent-pr-reviewer:${ROBOCO_VERSION:-latest} entrypoint: ["/bin/sh", "-c", "echo 'agent-pr-reviewer image present'"] restart: "no" agent-grok-image: image: ${ROBOCO_REGISTRY:-ghcr.io/rennf93}/roboco-agent-grok:${ROBOCO_VERSION:-latest} entrypoint: ["/bin/sh", "-c", "echo 'agent-grok image present'"] restart: "no" agent-grok-prompter-image: image: ${ROBOCO_REGISTRY:-ghcr.io/rennf93}/roboco-agent-grok-prompter:${ROBOCO_VERSION:-latest} entrypoint: ["/bin/sh", "-c", "echo 'agent-grok-prompter image present'"] restart: "no" agent-grok-secretary-image: image: ${ROBOCO_REGISTRY:-ghcr.io/rennf93}/roboco-agent-grok-secretary:${ROBOCO_VERSION:-latest} entrypoint: ["/bin/sh", "-c", "echo 'agent-grok-secretary image present'"] restart: "no" # Sandbox PG (kitchen-sink) — pulled by the provisioner when a venture opts # into pg extensions. Bare sandboxes use the upstream postgres image, so this # is only needed by extension-using projects. sandbox-pg-image: image: ${ROBOCO_REGISTRY:-ghcr.io/rennf93}/roboco-sandbox-pg:${ROBOCO_VERSION:-latest} entrypoint: ["/bin/sh", "-c", "echo 'sandbox-pg image present'"] restart: "no" # -------------------------------------------------------------------------- # Orchestrator — API server + agent spawner # -------------------------------------------------------------------------- orchestrator: image: ${ROBOCO_REGISTRY:-ghcr.io/rennf93}/roboco-orchestrator:${ROBOCO_VERSION:-latest} container_name: roboco-orchestrator restart: unless-stopped # Multi-homed: the agent mesh (default) for spawned agents / panel / # ollama, the data network for postgres/redis, plus render to reach the # isolated video-renderer sidecar. networks: - default - data - render ports: # Loopback-only: the orchestrator API is an unauthenticated control plane # in header-trust mode. nginx reaches it over the internal network, so it # never needs a routable host publish; remote access goes via nginx + cloud # auth. A 0.0.0.0 publish exposed spawn/stop and settings-write with no # credential to anyone who could reach the host (GHSA-4f7g-w95g-5q2c). - "127.0.0.1:8000:8000" environment: # DB network isolation is LIVE in this file (postgres/redis on the # data-only network): suppress the legacy prod-creds gate-env # injection — agents can't reach roboco-postgres anyway. This flag # must always travel with the networks: topology. ROBOCO_DB_NETWORK_ISOLATED: ${ROBOCO_DB_NETWORK_ISOLATED:-true} ROBOCO_DATABASE_HOST: roboco-postgres ROBOCO_DATABASE_PORT: 5432 ROBOCO_DATABASE_USER: roboco ROBOCO_DATABASE_PASSWORD: roboco ROBOCO_DATABASE_NAME: roboco ROBOCO_REDIS_HOST: roboco-redis ROBOCO_REDIS_PORT: 6379 ROBOCO_HOST: 0.0.0.0 ROBOCO_PORT: 8000 ROBOCO_ENCRYPTION_KEY: ${ROBOCO_ENCRYPTION_KEY:?ROBOCO_ENCRYPTION_KEY is required} ROBOCO_AGENT_AUTH_SECRET: ${ROBOCO_AGENT_AUTH_SECRET:?ROBOCO_AGENT_AUTH_SECRET is required} # Fail closed by default (GHSA-4f7g-w95g-5q2c): this deploy is # ROBOCO_ENVIRONMENT=production, and header-trust off a network-reachable # port lets any client claim X-Agent-Role: ceo. nginx injects the CEO # token below so the panel keeps working. Set false only on a trusted # private network with no untrusted reach to nginx. ROBOCO_AGENT_AUTH_REQUIRED: ${ROBOCO_AGENT_AUTH_REQUIRED:-true} ROBOCO_LOCAL_LLM_BASE_URL: http://roboco-ollama:11434/v1 ROBOCO_LOCAL_LLM_MODEL: glm-5.2:cloud ROBOCO_DEFAULT_EMBEDDING_MODEL: qwen3-embedding:0.6b ROBOCO_OLLAMA_BASE_URL: http://roboco-ollama:11434 # Video renderer sidecar (use container name). The video engine # itself is default-off (video_engine_enabled); this just points the # client at the sidecar for when it's armed. ROBOCO_VIDEO_RENDERER_BASE_URL: http://roboco-video-renderer:3001 # Spawn the PRE-BUILT agent images from the same registry instead of # building them from source (the orchestrator pulls any it lacks). ROBOCO_AGENT_IMAGE_REGISTRY: ${ROBOCO_REGISTRY:-ghcr.io/rennf93} ROBOCO_AGENT_IMAGE_TAG: ${ROBOCO_VERSION:-latest} # Host paths for spawning agent containers (Docker-in-Docker). MUST be # absolute paths on the host. Default to this compose project's ./data. ROBOCO_HOST_PROJECT_DIR: ${ROBOCO_HOST_PROJECT_DIR:-/opt/roboco} ROBOCO_HOST_CLAUDE_DIR: ${ROBOCO_HOST_CLAUDE_DIR:-${HOME}/.claude} # SuperGrok auth (host ~/.grok) for Grok-CLI agents — the orchestrator # mounts