Run the full stack locally with Docker Compose

🟢 open · #1 · rbhr/mike ← rbhr/mike · opened 16d ago by rbhr · self · +691 across 12 files · ↗ on GitHub

From the PR description

Summary

Adds a single-command, fully self-hosted local stack - no external accounts (no hosted Supabase, no cloud bucket). docker compose up --build brings up everything and you open http://localhost:3000.

No application code changes: the backend/frontend already read everything from env, and storage.ts / supabase.ts already accept custom endpoints.

Changes

  • docker-compose.yml - 9 services with health-gated ordering and named volumes:
    • Self-hosted Supabase: db (Postgres) + auth (GoTrue) + rest (PostgREST) behind an nginx gateway routing /auth/v1 and /rest/v1 - the only Supabase surfaces Mike uses.
    • minio for S3-compatible storage (backend already sets forcePathStyle) + a bucket-init step.
    • backend / frontend apps + one-shot schema-init / minio-init.
  • backend/Dockerfile - multi-stage; runtime installs LibreOffice (Debian) for doc/docx → pdf.
  • frontend/Dockerfile - multi-stage; bakes NEXT_PUBLIC_* at build time (they end up in the browser, so they point at host-published ports).
  • deploy/ - nginx gateway config, DB role bootstrap (anon/authenticated/service_role + auth on the search path), and the schema-load script.
  • .env.example, .dockerignores, README "Run with Docker" section, and docs/docker.md.
  • Also includes CLAUDE.md (repo guidance for Claude Code) as a separate commit.

Why

Lowers the barrier to trying Mike locally - previously you needed a Supabase project and an S3 bucket before the app would run. This makes it cp .env.example .env + add one model key + docker compose up.

Testing

Built and ran the full stack end-to-end on linux/arm64:

  • All services healthy; backend /health{"ok":true}.
  • Signup via GoTrue (auto-confirm); the on_auth_user_created trigger auto-creates the profile row.
  • Authenticated GET /user/profile → 200 (backend → gateway → PostgREST; 23 tables + all 4 overview RPCs present).
  • Docx upload → LibreOffice conversion → original + converted PDF both stored in MinIO.
  • Frontend serves 200 with the correct baked config.
  • Data persists across a full docker compose down / up.

Not exercised: live LLM chat (requires a provider key); the auth + PostgREST path it depends on is verified.

🤖 Generated with Claude Code

Our analysis

Add a fully self-hosted Docker Compose stack — read the full analysis →

Think the analysis missed something the PR description covers?

Capture this PR into my fork

Download a Markdown prompt that tells Claude how to port every commit in this PR into your working tree. Run it via claude -p < capture-pull-1.md from inside the repo you want the changes in.

⬇ Download capture-pull-1.md