[integrations] Run Open Brain locally via docker-compose (no Supabase, Ollama)#1
Merged
safixdev merged 5 commits intoJun 7, 2026
Conversation
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Direct-Postgres MCP server, multiarch bake (amd64+arm64), optional build-secret CA mount for TLS-intercepting proxies, full-graph deno cache for hermetic runtime. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Replaces named Docker volumes with host bind-mounts so data lives on the
Mac filesystem (docker/openbrain-data/{data,ollama}) and survives docker-compose
down without depending on colima's internal storage.
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
|
Hey @moisei — welcome to Open Brain Source! 👋 Thanks for submitting your first PR. The automated review will run shortly and check things like metadata, folder structure, and README completeness. If anything needs fixing, the review comment will tell you exactly what. Once the automated checks pass, a human admin will review for quality and clarity. Expect a response within a few days. If you have questions, check out CONTRIBUTING.md or open an issue. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Run Open Brain fully locally via
docker compose— three containers, one command, no cloud accounts required:db—pgvector/pgvector:pg16(Postgres + pgvector extension)ollama— local AI:mxbai-embed-large(1024-dim embeddings) +gemma3:4b(metadata extraction)server— the Deno MCP serverAll data (Postgres + Ollama models) stored as bind-mounts under
docker/openbrain-data/on the host filesystem — survivesdocker-compose down, no dependency on Docker's internal volume storage.Why Supabase was removed
The upstream stack uses
@supabase/supabase-jsin the server, which requires the full Supabase service bundle: PostgREST + Kong API gateway + GoTrue auth + realtime + storage — even though Open Brain only ever uses the database (one table, two SQL functions). Running that bundle locally viasupabase startadds ~4–5 Docker containers, a JWT to manage, and a PostgREST REST layer just to reach Postgres.By connecting the server directly to Postgres (replacing
supabase.rpc/.fromcalls withdeno-postgres+ raw SQL), the stack collapses to three containers and removes all the Supabase plumbing. The SQL functions (match_thoughts,upsert_thought) are unchanged — only the client layer changes.How — a
db.tsdata-access seamRather than forking a third copy of the server, this mirrors the existing
llm.tspattern: a thin seam with two drivers selected byDB_DRIVERenv var.supabase(default) — wraps the existingsupabase.rpc/.fromcalls verbatim. Zero behavior change for the upstream/Supabase path — existing deploys are unaffected.postgres—deno-postgresPool calling the same SQL functions (match_thoughts,upsert_thought) for identical semantics. Direct SELECT/UPDATE for list/stats/fetch.All
local-deployfeatures are preserved: dedup viaupsert_thoughtcontent fingerprint, date-injected metadata prompt, chat-error surfacing.Docker artifacts (
docker/)docker-compose.ymldb+ollama+ollama-pull(one-shot model downloader gates server start) +serverDockerfiledeno cache index.tsat build +--cached-onlyruntime — hermetic, no network at runtimedocker-bake.hcllinux/amd64+linux/arm64init/01-init.sqlcontent_fingerprint,upsert_thought,match_thoughts,vector(1024).env.example.env.secrets.exampleMCP_ACCESS_KEY+POSTGRES_PASSWORD(real file gitignored)README.mdDEVELOPING.mddocker/openbrain-data/is gitignored — Docker creates it on firstup.TLS proxy note
deno installinside the build container fails behind a TLS-intercepting corporate proxy because the base image doesn't trust the proxy's CA. The Dockerfile supports an optional BuildKit CA build-secret (--secret id=ca,src=corp-ca.pem) that is passed todeno installanddeno cachebut never baked into the image. Without the secret, the build behaves normally on a clean network. The same pattern is wired throughdocker-bake.hcl(CA_CERT=) anddocker-compose.yml(CA_CERT_FILE=).Verified end-to-end
deno checkclean;db_test.tsshape tests pass (postgres integration tests gated on live DB)docker compose up→ capture (metadata viagemma3:4b), semantic search (76–85% match viamxbai-embed-large+ pgvector), dedup (re-capture stays 1 row via fingerprint upsert), vectors are 1024-dimdocker/openbrain-data/on host afterdocker-compose downmcp-remotebridge)