Dshamir makes Mike run on one box, one command

Thirteen commits turn the upstream prototype into a self-hosted stack you can stand up on a single machine without a DevOps team.

infrastructure

Most legal-AI projects assume someone else hosts them. Dshamir is betting the opposite: that a firm wants the whole thing - database, file storage, login, document conversion, the works - running on hardware it controls. This thread wires together roughly a dozen moving parts so they boot together from one command, with sensible defaults and pinned versions for the pieces that matter.

What stands out is that this was debugged against a real, clean machine, not a developer's already-configured laptop. The script now hunts for free network ports and reroutes itself if something's already in use, and two build steps that only fail on a fresh checkout were tracked down and fixed. It's the unglamorous work that decides whether "clone and run" actually works for the next person who tries it.

So what If you're a legal-ops or IT lead weighing self-hosting an AI tool for data-control reasons, this is the fork that takes one-command, on-your-own-hardware deployment seriously.

View this fork on GitHub →

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

Commits in this thread

13 commits from Dshamir/AI-Legal, oldest first. Source extracted verbatim from the harvested git log.

SHA Subject Author Date
867e043f [P1] chore: add editorconfig, dockerignore, update gitignore Dshamir 2026-05-23 ↗ GitHub
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
85f89ed5 [P1] feat: add backend Dockerfile with LibreOffice Dshamir 2026-05-23 ↗ GitHub
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
f496de45 [P1] chore: add consolidated environment template Dshamir 2026-05-23 ↗ GitHub
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
9aefc9d6 [P1] feat: add frontend Dockerfile with standalone output Dshamir 2026-05-23 ↗ GitHub
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
cb2ce296 [P1] feat: add Nginx reverse proxy with upstream routing Dshamir 2026-05-23 ↗ GitHub
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
582919eb [P1] feat: add docker-compose with 11 services Dshamir 2026-05-23 ↗ GitHub
40c68333 [P1] feat: add ailegal.sh orchestration script Dshamir 2026-05-23 ↗ GitHub
Central CLI wrapping Docker Compose with build/rebuild/restart/health/status/
db/test/lint/bump/clean/nuke commands for the Mike platform's 11 services.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
d27cb584 [P1] feat: add docker-compose dev overrides example Dshamir 2026-05-23 ↗ GitHub
commit body
Provides hot-reload configuration for development. Targets the builder
stage of backend/frontend Dockerfiles and mounts source directories
read-only. Developers copy this to docker-compose.override.yml (which
is gitignored) for local customization.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
4d3904b1 feat: revise ailegal.sh with dynamic port allocation, smoke tests, three-layer health Dshamir 2026-05-23 ↗ GitHub
714c7d73 feat: add ASCII banner to ailegal.sh help and startup Dshamir 2026-05-23 ↗ GitHub
33604cd8 fix: fix Dockerfiles and Quick Start for working first-run experience Dshamir 2026-05-23 ↗ GitHub
commit body
Backend Dockerfile was missing prisma generate before tsc, causing build
failure. Frontend Dockerfile needed NEXT_PUBLIC_* env vars for Next.js
static generation. README Quick Start now shows the real flow: build,
up, migrate.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
734792f5 fix: wire dynamic port allocation through docker-compose.yml Dshamir 2026-05-23 ↗ GitHub
commit body
docker-compose.yml had hardcoded port literals (e.g. "5432:5432") so
ailegal.sh's dynamic port allocation was silently ignored - ports:auto
would reassign env vars but Compose always bound to defaults. Replace
all 11 host-side ports with ${VAR:-default}:container_port so exported
env vars actually take effect.

Also fix container ownership detection: ensure_dynamic_ports and
cmd_ports built container names from PORT_LABELS (e.g. mike-minio_api-1)
instead of the actual Compose service name (mike-minio-1), causing
multi-port services to always show CONFLICT. Add PORT_SERVICES array
mapping each port label to its Docker service name.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0ef9d600 fix: detect container port ownership by actual port binding, not name Dshamir 2026-05-23 ↗ GitHub
commit body
Container ownership detection guessed names like mike-postgres-1, but
Docker Compose defaults the project name from the directory (ai-legal),
so all ports showed CONFLICT. Replace with docker ps --filter publish=N
which finds the actual container holding each port regardless of project
name prefix. Also pass -p mike to docker compose for consistent naming
going forward.

Co-Authored-By: Claude Opus 4.7 (1M context) <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-519.md from inside the repo you want the changes in.

⬇ Download capture-thread-519.md