fix: add PYTHONPATH to docker-compose for pre-built images - #77
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe Docker Compose file now sets PYTHONPATH=/app/backend in the environment of both the CPU ( ChangesDocker Environment Setup
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
The pre-built GHCR image was built before the sys.path fix in backend/main.py (lines 8-10) was added. Without PYTHONPATH=/app/backend, uvicorn resolves backend.main:app but the module-level `from core.config import ...` at line 144 fails with ModuleNotFoundError: No module named 'core'. This causes the container to crash-loop on startup. Add PYTHONPATH=/app/backend to both CPU and GPU service definitions so that bare imports work regardless of which image version is pulled. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
b9399ee to
4bb721f
Compare
…nslate cuDNN sub-repo (#74) Docker GPU support hardening + documentation. - Restores docker compose --profile gpu up path; documents NVIDIA Container Toolkit setup in README - Splits CPU vs GPU compose services cleanly (deploy/docker-compose.yml) - backend/api/routers/setup/wizard.py: GPU detection in containerized environments uses torch.cuda fallback - New scripts/setup.py replaces deleted scripts/setup_cudnn.py - New test: tests/test_setup_preflight.py - CHANGELOG.md + README.md updated Complementary to PR #77 (community PYTHONPATH fix) — different sections of docker-compose.yml.
Summary
PYTHONPATH=/app/backendto both CPU and GPU service definitions indeploy/docker-compose.ymlProblem
The pre-built GHCR image (
ghcr.io/debpalash/omnivoice-studio:latest) was published before thesys.pathfix inbackend/main.py(lines 8–10) was added. Whendocker compose upstarts the container, uvicorn resolvesbackend.main:appsuccessfully, but the module-level import at line 144:fails with
ModuleNotFoundError: No module named 'core', causing the container to crash-loop on startup.The
Dockerfilealready setsENV PYTHONPATH=/app/backend, but the pre-built image on GHCR predates that line — the environment variable is absent from the published image (confirmed viadocker inspect).Fix
Explicitly set
PYTHONPATH=/app/backendindocker-compose.ymlfor bothomnivoice(CPU) andomnivoice-gpuservices. This works regardless of whether the image was built before or after thePYTHONPATH/sys.pathfixes.Test plan
docker compose -f deploy/docker-compose.yml up -d— container starts and reacheshealthystatusdocker compose -f deploy/docker-compose.yml --profile gpu up -d— GPU variant also has the fix/healthendpoint returns 200🤖 Generated with Claude Code
Summary by CodeRabbit