Self-host with Docker Compose and optional server-held keys
Problem
Running the app day to day on your own machine takes three processes (app, agent, MCP), and the existing apps/mcp/Dockerfile can't build from the repo: it expects an apps/mcp/pnpm-lock.yaml that doesn't exist, and @repo/design-system is a workspace dependency. Separately, the chat UI always asks for browser keys before sending, even when the agent already has shared keys in apps/agent/.env. The agent accepts header-less requests in that case (server_credentials_available), so the prompt is the only thing in the way.
Proposal
- A
docker-compose.ymlthat builds and runs the app, agent and MCP server, bound to127.0.0.1withrestart: unless-stopped. It reusesdocker/Dockerfile.app, addsapps/agent/Dockerfile(uv, frozen lock), and addsdocker/Dockerfile.mcp, which builds from the workspace root. - An opt-in, build-time
NEXT_PUBLIC_SERVER_KEYS=truethat treats server-held keys as configured, so the browser key prompt is skipped. It's off by default, so the hosted BYOK experience is unchanged. Compose sets it.
I noticed #9/#10 proposed Compose earlier and were closed; I don't know why. If self-hosting via Compose isn't something you want in this repo, that's fine. If it is, I have a PR ready and am happy to reshape it.