feat: add OCR service container (refs #64) #72

Merged
egullickson merged 5 commits from issue-64-ocr-container-setup into main 2026-02-01 20:49:52 +00:00
Owner

Summary

  • Add Python-based OCR service container (mvp-ocr) as the 6th service in docker-compose
  • Python 3.11-slim with FastAPI/uvicorn for the API framework
  • Tesseract OCR with English language pack for text extraction
  • pillow-heif for HEIC image support (iPhone photos)
  • opencv-python-headless for image preprocessing
  • Health endpoint at /health returns {"status": "healthy"}
  • Unit tests verify health endpoint, HEIC support, and Tesseract availability

Test plan

  • mvp-ocr container builds successfully
  • Container starts and passes health check
  • FastAPI app responds at /health with {"status": "healthy"}
  • pillow-heif can load HEIC images (unit test)
  • Tesseract can process a test image (unit test)
  • Container integrates with existing backend network
  • docker-compose.yml shows 6 services configured

Closes #64


Generated with Claude Code

## Summary - Add Python-based OCR service container (`mvp-ocr`) as the 6th service in docker-compose - Python 3.11-slim with FastAPI/uvicorn for the API framework - Tesseract OCR with English language pack for text extraction - pillow-heif for HEIC image support (iPhone photos) - opencv-python-headless for image preprocessing - Health endpoint at `/health` returns `{"status": "healthy"}` - Unit tests verify health endpoint, HEIC support, and Tesseract availability ## Test plan - [x] `mvp-ocr` container builds successfully - [x] Container starts and passes health check - [x] FastAPI app responds at `/health` with `{"status": "healthy"}` - [x] pillow-heif can load HEIC images (unit test) - [x] Tesseract can process a test image (unit test) - [x] Container integrates with existing backend network - [x] docker-compose.yml shows 6 services configured Closes #64 --- Generated with [Claude Code](https://claude.ai/code)
egullickson added 1 commit 2026-02-01 19:06:31 +00:00
feat: add OCR service container (refs #64)
Some checks failed
Deploy to Staging / Build Images (pull_request) Successful in 7m41s
Deploy to Staging / Deploy to Staging (pull_request) Failing after 13s
Deploy to Staging / Verify Staging (pull_request) Has been skipped
Deploy to Staging / Notify Staging Ready (pull_request) Has been skipped
Deploy to Staging / Notify Staging Failure (pull_request) Successful in 8s
1ba491144b
Add Python-based OCR service container (mvp-ocr) as the 6th service:
- Python 3.11-slim with FastAPI/uvicorn
- Tesseract OCR with English language pack
- pillow-heif for HEIC image support
- opencv-python-headless for image preprocessing
- Health endpoint at /health
- Unit tests for health, HEIC support, and Tesseract availability

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
egullickson added 1 commit 2026-02-01 19:19:39 +00:00
fix: add OCR image to CI/CD workflows (refs #64)
Some checks failed
Deploy to Staging / Build Images (pull_request) Successful in 3m38s
Deploy to Staging / Deploy to Staging (pull_request) Successful in 28s
Deploy to Staging / Verify Staging (pull_request) Failing after 6s
Deploy to Staging / Notify Staging Ready (pull_request) Has been skipped
Deploy to Staging / Notify Staging Failure (pull_request) Successful in 7s
99ee00b225
- Add OCR image build/push to staging workflow
- Add OCR service with image override to staging compose
- Add OCR service with image override to blue-green compose
- Add OCR image pull/deploy to production workflow
- Include mvp-ocr-staging in health checks

The OCR container is a shared service (like postgres/redis),
not part of blue-green deployment.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
egullickson added 1 commit 2026-02-01 19:28:15 +00:00
fix: move user-profile before documents in migration order (refs #64)
Some checks failed
Deploy to Staging / Build Images (pull_request) Successful in 31s
Deploy to Staging / Deploy to Staging (pull_request) Successful in 31s
Deploy to Staging / Verify Staging (pull_request) Failing after 53s
Deploy to Staging / Notify Staging Ready (pull_request) Has been skipped
Deploy to Staging / Notify Staging Failure (pull_request) Successful in 8s
3781b05d72
The documents migration 003_reset_scan_for_maintenance_free_users.sql
depends on user_profiles table which is created by user-profile feature.
Move user-profile earlier in MIGRATION_ORDER to fix staging deployment.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
egullickson added 1 commit 2026-02-01 19:55:04 +00:00
fix: increase staging health check timeout to 4 minutes (refs #64)
Some checks failed
Deploy to Staging / Build Images (pull_request) Successful in 30s
Deploy to Staging / Deploy to Staging (pull_request) Successful in 31s
Deploy to Staging / Verify Staging (pull_request) Failing after 1m28s
Deploy to Staging / Notify Staging Ready (pull_request) Has been skipped
Deploy to Staging / Notify Staging Failure (pull_request) Successful in 7s
99fbf2bbb7
Backend with fresh migrations can take ~3 minutes to start.
Increased from 10x5s (50s) to 24x10s (240s) to accommodate.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
egullickson added 1 commit 2026-02-01 20:43:31 +00:00
fix: increase backend Docker healthcheck start_period to 3 minutes (refs #64)
All checks were successful
Deploy to Staging / Build Images (pull_request) Successful in 30s
Deploy to Staging / Deploy to Staging (pull_request) Successful in 31s
Deploy to Staging / Verify Staging (pull_request) Successful in 2m19s
Deploy to Staging / Notify Staging Ready (pull_request) Successful in 7s
Deploy to Staging / Notify Staging Failure (pull_request) Has been skipped
a31028401b
The CI was failing because Docker marked the backend unhealthy before the CI
wait loop completed. The backend needs time to run migrations and seed vehicle
data on startup.

Changes:
- start_period: 40s -> 180s (3 minutes)
- retries: 3 -> 5 (more tolerance)

Total time before unhealthy: 180s + (5 × 30s) = 5.5 minutes

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
egullickson merged commit 42e0fc1fce into main 2026-02-01 20:49:52 +00:00
egullickson deleted branch issue-64-ocr-container-setup 2026-02-01 20:49:52 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: egullickson/motovaultpro#72