Skip to content

fix: End-to-end Docker overhaul — from broken setup to production-ready in one command#406

Open
utkarshqz wants to merge 10 commits intofireform-core:mainfrom
utkarshqz:fix/docker-production-setup
Open

fix: End-to-end Docker overhaul — from broken setup to production-ready in one command#406
utkarshqz wants to merge 10 commits intofireform-core:mainfrom
utkarshqz:fix/docker-production-setup

Conversation

@utkarshqz
Copy link
Copy Markdown

Description

FireForm can now be deployed end-to-end with a single command.

Before this PR, the Docker setup was broken in 10 different ways simultaneously — missing system libraries, wrong Python path, no port mapping, a server that never started, and an AI model that was never pulled. Every new contributor hit the same wall. Every station administrator who tried to self-host got the same crash.

This PR tears it all down and rebuilds it right.

After this PR, any contributor or station administrator — on any OS, with no prior setup — can do this:

git clone https://github.com/fireform-core/FireForm && cd FireForm
docker compose build && docker compose up -d

And get a fully running, AI-powered, offline-capable FireForm instance at http://localhost:8000 — with the Mistral model, full API, Swagger docs, and PWA mobile client all live and working.

No manual library installation. No PATH debugging. No silent failures.


What Was Broken (Root Cause Analysis)

Issue File Root Cause Fix
#275 #191 #184 Dockerfile Missing libGL.so.1 + libgthread-2.0.so.0 — required by faster-whisper Added libgl1, libglib2.0-0
#53 Dockerfile libxcb.so.1 missing from python:3.11-slim base image Added libxcb1
Dockerfile ffmpeg missing — required by faster-whisper audio processing Added ffmpeg
#118 #116 Dockerfile + docker-compose.yml PYTHONPATH=/app/src broke every single api.* import Corrected to PYTHONPATH=/app
#224 docker-compose.yml No ports: — the API server was completely unreachable from the host Added ports: ["8000:8000"]
#382 Makefile make fireform never pulled Mistral — all LLM calls failed silently at runtime Added pull-model to fireform target
Makefile make test pointed to src/test/ which does not exist Corrected to tests/
Dockerfile CMD ["tail", "-f", "/dev/null"] — container ran but FastAPI never started Replaced with uvicorn api.main:app --host 0.0.0.0 --port 8000
docker-compose.yml Healthcheck used ollama ps — not available in the Ollama image, caused instant failure Removed; replaced with restart: unless-stopped
requirements.txt python-multipart missing — FastAPI crashes at startup without it Added python-multipart

What FireForm Runs Now (After This PR)

Service Where What it does
FastAPI server http://localhost:8000 All API routes — extract, fill, generate, transcribe
Swagger UI http://localhost:8000/docs Interactive API docs
PWA mobile client http://localhost:8000/mobile Offline-capable field companion
Ollama / Mistral http://localhost:11434 (internal) AI extraction + semantic PDF mapping

Fully offline after first model pull. Zero cloud dependency. CJIS/GDPR-safe by design.


Fixes #275
Fixes #191
Fixes #184
Fixes #53
Fixes #224
Fixes #118
Fixes #116
Fixes #382


Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • This change requires a documentation update

How Has This Been Tested?

Full end-to-end deployment tested on Windows 11 + WSL2 + Docker Desktop 29.3.1 (CPU only, no NVIDIA GPU).

docker compose build    # ✅  Image fireform-app Built
docker compose up -d    # ✅  fireform-ollama Started + fireform-app Started
docker ps               # ✅  fireform-app Up  0.0.0.0:8000->8000  |  fireform-ollama Up  0.0.0.0:11434->11434
docker compose logs app # ✅  "Application startup complete."
                        # ✅  "Uvicorn running on http://0.0.0.0:8000"
# Open http://localhost:8000/docs → Swagger UI loads and all routes are reachable ✅

Test Configuration:

  • OS: Windows 11 + WSL2
  • Docker: Desktop 29.3.1 (build c2be9cc)
  • Hardware: Laptop, CPU-only (no NVIDIA GPU — proving CPU inference works)
  • Python base image: python:3.11-slim

Screenshots

Build — docker compose build

Screenshot 2026-03-31 200711

Deployment — docker compose up -d + docker ps

Screenshot 2026-03-31 204337

API Live — http://localhost:8000/docs

Screenshot 2026-03-31 204423

Files Changed

File Change
Dockerfile System libs, PYTHONPATH, EXPOSE 8000, uvicorn CMD
docker-compose.yml Port mapping, PYTHONPATH, healthcheck fix
Makefile fireform target auto-pulls model, test path fixed, make run added
requirements.txt Added python-multipart
docs/DEPLOYMENT.md New file — complete station administrator deployment guide

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (docs/DEPLOYMENT.md added)
  • My changes generate no new warnings
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment