HF's edge probes GET / on every Space to decide whether it's
'running'. Our FastAPI app exposed /health and /extract but no root
route, so the probe got 404, HF marked the Space unhealthy, and
killed the container after the 30-min grace window:
Launch timed out, workload was not healthy after 30 min
INFO: Started server process [1]
INFO: Uvicorn running on http://[::]:7860
INFO: Shutting down
Add a GET / handler returning the same {ok: true} shape so the
probe passes and the Space stays up.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
feat(card-ocr): PaddleOCR sidecar with Railway-ready config
- Dockerfile: pin python:3.11-slim (paddlepaddle 2.6.2 wheel needs 3.11),
drop opencv-python + opencv-contrib-python so headless variant is the
only libcv on the path (prevents double-free on first OCR), bake the
English model weights into the image so the first request after a
deploy isn't a ~10s download.
- main.py: emit per-line `blocks` with text + confidence so the Django
side can attribute Haiku-extracted fields back to a specific OCR line
(per-field confidence aggregation).
- railway.json: explicit Dockerfile builder + dual-stack `--host ::`
+ healthcheck-friendly `--port \${PORT:-8001}` start command so
Railway's private network can route to the container.
- .dockerignore: belt-and-suspenders so build scratch / test files
don't leak into the production image.
- docker-compose.yml: card-ocr service block with healthcheck +
service_started dep on backend (relaxed from service_healthy so
local stub-mode dev doesn't block on the heavy sidecar build).
- .env.ex…
chore: consolidate plans, add explicit permissions, and update onboarding flow