OpenGenerativeUI icon indicating copy to clipboard operation
OpenGenerativeUI copied to clipboard

Self-host with Docker Compose and optional server-held keys

Open kannan983 opened this issue 1 month ago • 0 comments

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

  1. A docker-compose.yml that builds and runs the app, agent and MCP server, bound to 127.0.0.1 with restart: unless-stopped. It reuses docker/Dockerfile.app, adds apps/agent/Dockerfile (uv, frozen lock), and adds docker/Dockerfile.mcp, which builds from the workspace root.
  2. An opt-in, build-time NEXT_PUBLIC_SERVER_KEYS=true that 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.

kannan983 avatar Oct 10 '26 08:10 kannan983