services: # ========================================================================== # PostgreSQL - Primary Database with pgvector for RAG # ========================================================================== 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 - Cache, Sessions, Event Bus # ========================================================================== 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 # ========================================================================== # MinIO - Object storage for rendered videos (NAS default-on; registry OFF) # ========================================================================== minio: image: minio/minio:latest container_name: roboco-minio restart: unless-stopped # data-only network — keeps MinIO off the agent mesh; the multi-homed # orchestrator reaches it via its data NIC. Host ports for debugging. networks: - data command: server /data --console-address ":9001" environment: MINIO_ROOT_USER: ${ROBOCO_MINIO_ACCESS_KEY:-minio} MINIO_ROOT_PASSWORD: ${ROBOCO_MINIO_SECRET_KEY:-minio123} ports: - "19000:9000" - "19001:9001" volumes: - minio-data:/data healthcheck: test: ["CMD", "mc", "ready", "local"] interval: 10s timeout: 5s retries: 5 start_period: 10s # MinIO bucket init - one-shot, mirrors the ollama-init pattern: depends on # minio healthy, creates the bucket idempotently, then exits. `|| true` # covers re-runs (bucket already exists). minio-init: image: minio/mc:latest container_name: roboco-minio-init depends_on: minio: condition: service_healthy networks: - data entrypoint: ["/bin/sh", "-c"] # Note: $$ escapes $ for docker-compose variable substitution so the # container's own env vars reach mc. command: - mc alias set local http://roboco-minio:9000 $$ROBOCO_MINIO_ACCESS_KEY $$ROBOCO_MINIO_SECRET_KEY && mc mb -p local/$$ROBOCO_MINIO_BUCKET || true environment: ROBOCO_MINIO_ACCESS_KEY: ${ROBOCO_MINIO_ACCESS_KEY:-minio} ROBOCO_MINIO_SECRET_KEY: ${ROBOCO_MINIO_SECRET_KEY:-minio123} ROBOCO_MINIO_BUCKET: ${ROBOCO_MINIO_BUCKET:-roboco-video-renders} restart: "no" # ========================================================================== # Ollama - Local LLM and Embedding Server # ========================================================================== 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: # Use ollama CLI (guaranteed available) to check if server is responding test: ["CMD", "ollama", "list"] interval: 10s timeout: 5s retries: 5 start_period: 10s # Ollama model puller - pulls required models on startup # Uses streaming curl to wait for full model download 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). Mirrors the ollama sidecar # pattern: a plain HTTP service the orchestrator talks to, nothing more. # Harmless when idle — it only renders when POSTed; the video_engine_* # feature flags gate whether the orchestrator ever sends it work. No DB # access, no git, no credentials — it only ever reads what it's POSTed. # ========================================================================== video-renderer: build: context: . dockerfile: docker/video-renderer.Dockerfile image: roboco-video-renderer 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 Base Image Builder (specialized images built on-demand by orchestrator) # ========================================================================== agent-base-image: build: context: . dockerfile: docker/agent-base.Dockerfile image: roboco-agent-base container_name: roboco-agent-base-builder entrypoint: ["/bin/sh", "-c", "echo 'Agent base image built successfully'"] restart: "no" # ========================================================================== # Agent PM Image Builder (specialized image built on-demand by orchestrator) # ========================================================================== agent-pm-image: build: context: . dockerfile: docker/agent-pm.Dockerfile image: roboco-agent-pm entrypoint: ["/bin/sh", "-c", "echo 'Agent PM image built'"] restart: "no" depends_on: - agent-base-image # ========================================================================== # Agent Backend Dev Image Builder (specialized image built on-demand by orchestrator) # ========================================================================== agent-dev-be-image: build: context: . dockerfile: docker/agent-dev-be.Dockerfile image: roboco-agent-dev-be entrypoint: ["/bin/sh", "-c", "echo 'Agent Backend Dev image built'"] restart: "no" depends_on: - agent-base-image # ========================================================================== # Agent Frontend Dev Image Builder (specialized image built on-demand by orchestrator) # ========================================================================== agent-dev-fe-image: build: context: . dockerfile: docker/agent-dev-fe.Dockerfile image: roboco-agent-dev-fe entrypoint: ["/bin/sh", "-c", "echo 'Agent Frontend Dev image built'"] restart: "no" depends_on: - agent-base-image # ========================================================================== # Agent Backend QA Image Builder (specialized image built on-demand by orchestrator) # ========================================================================== agent-qa-be-image: build: context: . dockerfile: docker/agent-qa-be.Dockerfile image: roboco-agent-qa-be entrypoint: ["/bin/sh", "-c", 'echo "Agent Backend QA image built"'] restart: "no" depends_on: - agent-base-image # ========================================================================== # Agent Frontend QA Image Builder (specialized image built on-demand by orchestrator) # ========================================================================== agent-qa-fe-image: build: context: . dockerfile: docker/agent-qa-fe.Dockerfile image: roboco-agent-qa-fe entrypoint: ["/bin/sh", "-c", 'echo "Agent Frontend QA image built"'] restart: "no" depends_on: - agent-base-image # ========================================================================== # Agent UX/UI Dev Image Builder (specialized image built on-demand by orchestrator) # ========================================================================== agent-ux-image: build: context: . dockerfile: docker/agent-ux.Dockerfile image: roboco-agent-ux entrypoint: ["/bin/sh", "-c", 'echo "Agent UX/UI image built"'] restart: "no" depends_on: - agent-base-image # ========================================================================== # Agent Documenter Image Builder (specialized image built on-demand by orchestrator) # ========================================================================== agent-doc-image: build: context: . dockerfile: docker/agent-doc.Dockerfile image: roboco-agent-doc entrypoint: ["/bin/sh", "-c", 'echo "Agent Documenter image built"'] restart: "no" depends_on: - agent-base-image # ========================================================================== # Agent Intake (Prompter) Image Builder (persistent Agent-SDK driver the CEO # chats with; not a one-shot `claude -p`) # ========================================================================== agent-prompter-image: build: context: . dockerfile: docker/agent-prompter.Dockerfile image: roboco-agent-prompter entrypoint: ["/bin/sh", "-c", 'echo "Agent Intake image built"'] restart: "no" depends_on: - agent-base-image agent-secretary-image: build: context: . dockerfile: docker/agent-secretary.Dockerfile image: roboco-agent-secretary entrypoint: ["/bin/sh", "-c", 'echo "Agent Secretary image built"'] restart: "no" depends_on: - agent-base-image # ========================================================================== # Agent PR Reviewer Image Builder (read-only reviewer of inbound external PRs) # ========================================================================== agent-pr-reviewer-image: build: context: . dockerfile: docker/agent-pr-reviewer.Dockerfile image: roboco-agent-pr-reviewer entrypoint: ["/bin/sh", "-c", 'echo "Agent PR Reviewer image built"'] restart: "no" depends_on: - agent-base-image # ========================================================================== # Agent Grok Image Builder (xAI Grok Build via the official grok CLI) # ========================================================================== agent-grok-image: build: context: . dockerfile: docker/agent-grok.Dockerfile image: roboco-agent-grok entrypoint: ["/bin/sh", "-c", 'echo "Agent Grok image built"'] restart: "no" depends_on: - agent-base-image # Interactive Grok roles (intake/secretary) — panel-driven grok-CLI sessions; # built FROM roboco-agent-grok, so they depend on the Grok runtime image. agent-grok-prompter-image: build: context: . dockerfile: docker/agent-grok-prompter.Dockerfile image: roboco-agent-grok-prompter entrypoint: ["/bin/sh", "-c", 'echo "Agent Grok Prompter image built"'] restart: "no" depends_on: - agent-grok-image agent-grok-secretary-image: build: context: . dockerfile: docker/agent-grok-secretary.Dockerfile image: roboco-agent-grok-secretary entrypoint: ["/bin/sh", "-c", 'echo "Agent Grok Secretary image built"'] restart: "no" depends_on: - agent-grok-image # ========================================================================== # Orchestrator - API Server + Agent Spawner # ========================================================================== orchestrator: build: context: . dockerfile: docker/orchestrator.Dockerfile image: roboco-orchestrator 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: - "8000:8000" environment: # Database (use container name, not localhost) ROBOCO_DATABASE_HOST: roboco-postgres ROBOCO_DATABASE_PORT: 5432 ROBOCO_DATABASE_USER: roboco ROBOCO_DATABASE_PASSWORD: roboco ROBOCO_DATABASE_NAME: roboco # Redis (use container name) ROBOCO_REDIS_HOST: roboco-redis ROBOCO_REDIS_PORT: 6379 # API ROBOCO_HOST: 0.0.0.0 ROBOCO_PORT: 8000 ROBOCO_ENCRYPTION_KEY: ${ROBOCO_ENCRYPTION_KEY:?ROBOCO_ENCRYPTION_KEY is required} # HMAC secret for agent auth tokens. Orchestrator signs tokens # per-agent at spawn; API middleware verifies them. Generate with: # python -c 'import secrets; print(secrets.token_hex(32))' ROBOCO_AGENT_AUTH_SECRET: ${ROBOCO_AGENT_AUTH_SECRET:?ROBOCO_AGENT_AUTH_SECRET is required} # Set to "true" to require tokens on every API call (fail-closed). # Leave unset/false during rollout so the panel + curl still work. ROBOCO_AGENT_AUTH_REQUIRED: ${ROBOCO_AGENT_AUTH_REQUIRED:-false} # Ollama (use container name) 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 # MinIO object storage for rendered videos (use container name). Empty # endpoint = disabled (FileResponse fallback); armed here for the NAS # deploy, left OFF in docker-compose.registry.yml. ROBOCO_MINIO_ENDPOINT: http://roboco-minio:9000 ROBOCO_MINIO_ACCESS_KEY: ${ROBOCO_MINIO_ACCESS_KEY:-minio} ROBOCO_MINIO_SECRET_KEY: ${ROBOCO_MINIO_SECRET_KEY:-minio123} ROBOCO_MINIO_BUCKET: ${ROBOCO_MINIO_BUCKET:-roboco-video-renders} ROBOCO_MINIO_REGION: ${ROBOCO_MINIO_REGION:-us-east-1} # Host paths for spawning agent containers (required for Docker-in-Docker) # IMPORTANT: These must be ABSOLUTE paths on the host filesystem ROBOCO_HOST_PROJECT_DIR: ${ROBOCO_HOST_PROJECT_DIR:-/volume1/roboco} ROBOCO_HOST_CLAUDE_DIR: ${ROBOCO_HOST_CLAUDE_DIR:-/home/renzof/.claude} # SuperGrok auth (host ~/.grok) for Grok-CLI agents — the orchestrator # mounts