Deployment
Running ForkReason yourself.
Requirements
- Python 3.12+, Node.js 20+
- PostgreSQL 14+
- Docker, only if you want Studio Mode locally
Backend
uv venv --python 3.12 .venv
uv pip install --python .venv/bin/python -r requirements-api.txt
cp .env.example .env # then edit DATABASE_URL
.venv/bin/python -m alembic upgrade headProcesses
# API
PYTHONPATH=apps/api .venv/bin/python -m uvicorn forkreason.main:app --host 127.0.0.1 --port 8421
# worker
PYTHONPATH=apps/api .venv/bin/python -m forkreason.jobs.runnerFrontend
cd apps/web && npm ci && npm run build && npm startIn front of nginx
Serve the frontend and proxy /api to the API process. Terminate TLS, redirect HTTP to HTTPS, set security headers, and let the Next middleware handle the CSP with its per-request nonce.
The API and worker must be separate durable processes. Analysis belongs in the worker, never in a request.