Backend that provisions per-user OpenCode + Gitea Docker pair via
dockerode and exposes the Grow Agent / sub-agent Rivet Kit actors
described in the PRD. Sub-agent workflows route through the parent
Grow Agent's OpenCode Docker.
- src/docker/manager.ts spawns growqr-gitea-<userId> and growqr-opencode-<userId>
- src/actors/{grow-agent,sub-agent,registry}.ts: Rivet Kit actors
- src/routes/{actors,opencode,git}.ts: PRD section 5.2-5.4 HTTP API
- docker-compose.yml runs rivet-engine + backend (mounts host Docker socket)
- PRD updated to lock in per-user OpenCode/Gitea Docker topology
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
50 lines
1.7 KiB
YAML
50 lines
1.7 KiB
YAML
services:
|
|
# Self-hosted Rivet engine. The backend's Rivet Kit client connects here.
|
|
# Per the PRD, the Grow Agent + sub-agents are durable actors running on Rivet.
|
|
rivet-engine:
|
|
image: rivetgg/engine:latest
|
|
container_name: growqr-rivet
|
|
ports:
|
|
- "6420:6420" # API
|
|
- "6421:6421" # Guard/edge
|
|
environment:
|
|
RIVET__AUTH__ADMIN_TOKEN: ${RIVET_ADMIN_TOKEN:-dev-admin-token}
|
|
volumes:
|
|
- rivet-data:/data
|
|
restart: unless-stopped
|
|
|
|
# The HTTP backend (Hono + Rivet Kit client + Docker manager).
|
|
# Mounts the host Docker socket so it can spawn per-user containers.
|
|
backend:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
container_name: growqr-backend
|
|
depends_on:
|
|
- rivet-engine
|
|
ports:
|
|
- "4000:4000"
|
|
environment:
|
|
PORT: 4000
|
|
RIVET_ENDPOINT: http://rivet-engine:6420
|
|
GITEA_IMAGE: ${GITEA_IMAGE:-gitea/gitea:1.22}
|
|
OPENCODE_IMAGE: ${OPENCODE_IMAGE:-ghcr.io/sst/opencode:latest}
|
|
USER_CONTAINER_HOST: ${USER_CONTAINER_HOST:-127.0.0.1}
|
|
USER_DATA_ROOT: /data/users
|
|
USER_PORT_RANGE_START: 20000
|
|
USER_PORT_RANGE_END: 29999
|
|
volumes:
|
|
# Docker-out-of-Docker: backend uses host Docker to spawn user containers.
|
|
- /var/run/docker.sock:/var/run/docker.sock
|
|
# Shared host dir that per-user containers will also bind-mount their
|
|
# workspace from (so backend and spawned containers see the same files).
|
|
- ./.data/users:/data/users
|
|
restart: unless-stopped
|
|
|
|
# Note: per-user OpenCode + Gitea containers are NOT defined here.
|
|
# The backend spawns them dynamically via dockerode on /actors/provision.
|
|
# See src/docker/manager.ts.
|
|
|
|
volumes:
|
|
rivet-data:
|