Dshamir makes AI-Legal something you can run on your own servers

This fork turns the cloud-dependent upstream into a turnkey package a firm can stand up in-house.

infrastructure

Dshamir's central move is self-hosting. Where the original AI-Legal leans on a hosted cloud backend (Supabase) for storage, authentication, and database, this fork packages the whole system into containers - self-contained bundles that run the same way on any machine - and even runs local copies of the cloud pieces instead of depending on the vendor. The backend even ships with LibreOffice built in so it can convert documents without an outside service.

The other half of the work is a single setup script that builds, health-checks, and launches all the moving parts with one command. Much of the recent effort went into making that first run actually work - sorting out port conflicts and build steps that tripped up early installs - which is the difference between a demo and something an IT team can deploy.

So what Worth a look for any firm that wants legal AI running entirely on its own infrastructure rather than a third party's cloud.

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