amal66 makes Mike a self-hosted proposition

This fork packages the platform for organisations that want more control over where legal work and data run.

infrastructuresecurity

amal66 has added a self-hosted deployment stack that brings the full platform together locally, including its database, user access, file storage and email services. The practical aim is simple: make it easier to stand up Mike under an operator's own control rather than assembling each moving part separately.

  • Local AI models: organisations can optionally use Ollama, a tool for running language models on their own hardware.
  • Configurable access: published services, sign-up rules and authentication addresses can be adjusted for the deployment.
  • Safer defaults: supporting infrastructure can be kept on the local machine rather than exposed broadly by default.

It is a meaningful operational step, not a production-security guarantee: anyone adopting it should still review credentials, storage and network settings before going live.

So what Legal teams with strict hosting requirements, and product teams selling into them, should care because self-hosting is becoming a practical deployment option rather than a bespoke integration project.

View this fork on GitHub →

Spotted something wrong? Or know the PR text has fresher detail than the writeup above?

Commits in this thread

8 commits from amal66/mike, oldest first. Source extracted verbatim from the harvested git log.

SHA Subject Author Date
5719dd1d feat(chapter-27): add Docker Compose for local self-hosting Amal 2026-05-24 ↗ GitHub
commit body
Chapter: 27 - Self-hosting path.

Plain-English map:
Add Dockerfiles and Docker Compose configuration so contributors can run a
local web/API setup with less manual environment work.

Why it matters:
If local setup is fragile, forks drift because everyone solves deployment
differently. A supported path keeps more work shareable upstream.

Principle:
Self-hosting should be boring and documented.

Precedent borrowed:
Upstream PRs #44, #63, and #149 plus the fork report's large local/self-hosted
stack cluster.

Upstream base: willchen96/mike@d39f580.
Original local commit: b2ae01c.
fe942475 Add self-hosted Docker stack with local Supabase, storage, email, and Ollama Thijs de Zoete 2026-06-29 ↗ GitHub
commit body
Bring the whole app up with a single `docker compose up` and no external
accounts.

Self-contained stack:
- Embedded Supabase (Postgres + GoTrue auth + PostgREST + an nginx gateway),
  with the schema auto-loaded on first boot and auth emails auto-confirmable.
- RustFS for S3-compatible object storage, replacing Cloudflare R2.
- Mailpit catches auth emails (signup/confirmation) in a local inbox.
- Production-style image builds for the frontend and backend.

Local models via Ollama:
- New provider speaking Ollama's OpenAI-compatible chat API, including the
  agentic tool-call loop and a graceful fallback for models that don't
  support tools.
- Models are detected dynamically (GET /models/ollama) and appear in every
  model picker (chat, title, tabular review) under a "Local" group, with no
  API key required. Any `ollama/<tag>` id is valid by prefix.
- Manual "Refresh" button on the API Keys page re-detects installed models
  and re-checks key status, pushing updates live to the pickers.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
b33b47af docs: add design spec for legal workflows (C&D, contract triage, MSA review) Thijs de Zoete 2026-06-29 ↗ GitHub
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
11bd520c fix(compose): make env files optional so hosted deploys work Thijs de Zoete 2026-07-20 ↗ GitHub
commit body
env_file: ./backend/.env was a hard failure when the file is absent, which
is always the case on Dokploy and similar platforms that inject env vars
rather than committing a .env.

Both backend/.env and the compose-root .env are now optional sources, root
last so hosted values win. Secrets deliberately stay out of environment:,
which overrides env_file - a bare name unset on the host silently blanks
out the value the file supplied.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
969233d8 fix(compose): make published ports configurable, bind infra to loopback Thijs de Zoete 2026-07-20 ↗ GitHub
commit body
Fixed host ports assume a dev machine. On Dokploy, 3000 is the dashboard's,
so the frontend fails with 'port is already allocated'. Each published port
now takes an env override with the current value as default, so local dev is
unchanged.

Infra ports (postgres, mailpit, storage) now bind 127.0.0.1 instead of
0.0.0.0. They were reachable from the internet on a public host while still
carrying default credentials, and the mailpit inbox exposes password-reset
links. Compose service-to-service networking is unaffected.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
d26fe041 fix(compose): make auth URLs and signup policy configurable Thijs de Zoete 2026-07-20 ↗ GitHub
commit body
GoTrue's API_EXTERNAL_URL and SITE_URL were hardcoded to localhost, so
confirmation links pointed at the user's own machine and signup could never
be completed on a hosted deploy. Both now derive from the public URLs.

MAILER_AUTOCONFIRM and DISABLE_SIGNUP are configurable too: a host with no
real SMTP needs autoconfirm on to register at all, and open registration
should be closable once the operator has an account. Defaults unchanged, so
local dev still exercises the real email flow via Mailpit.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
168b6977 feat(llm): optional bearer auth for the local/OpenAI-compatible provider Thijs de Zoete 2026-07-21 ↗ GitHub
commit body
Bare Ollama needs no auth, but OpenAI-compatible servers behind a gateway
(vLLM --api-key, Open WebUI, LiteLLM) require a bearer token. OLLAMA_API_KEY,
when set, is sent on both model discovery and chat completions; absent, the
provider behaves exactly as before.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ea7cb9ab fix(e2e): move roles.sql out of supabase/ so the CLI stops seeding it Amalanand Muthukumaran 2026-07-31 ↗ GitHub
commit body
The Supabase CLI auto-seeds supabase/roles.sql as globals during
'supabase start'. On the current supabase/postgres 17.x images that
seed connection is not a superuser, and supabase_auth_admin is a
reserved role, so ALTER ROLE fails with SQLSTATE 42501 and kills the
e2e job before Playwright runs.

The file only exists for the docker-compose stack, where it runs as
the init superuser via /docker-entrypoint-initdb.d. Move it to
docker/db-init/ and update the compose mount; CI's 'supabase start'
no longer sees it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Capture this thread into my fork

Download a single Markdown prompt that tells Claude how to port every commit above into your working tree — adapting paths and structure to match your repo. Run it via claude -p < capture-thread-1314.md from inside the repo you want the changes in.

⬇ Download capture-thread-1314.md