fix: add PYTHONPATH=/app so winnow entry point finds its package
uv sync runs before winnow/ is COPY'd into the build stage, so the wheel uv builds contains only dist-info (no Python files). The console_scripts entry point sets sys.path[0] to its own directory (/app/.venv/bin), not /app, so 'from winnow.cli import main' fails at container startup. PYTHONPATH=/app makes the package importable regardless of how Python is invoked (script, -m, entry point, docker exec). This is preferable to re-ordering the COPY layers, which would bust the heavy uv sync cache on every winnow/ source change. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+4
-1
@@ -84,7 +84,10 @@ RUN groupadd -g 568 apps && useradd -u 568 -g apps -m -s /bin/bash appuser \
|
|||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
USER appuser
|
USER appuser
|
||||||
ENV HF_HOME=/models/huggingface INSIGHTFACE_HOME=/models/.insightface
|
# PYTHONPATH=/app makes the winnow package importable from the entry point script.
|
||||||
|
# uv sync builds the wheel before winnow/ is COPY'd, so site-packages has only
|
||||||
|
# the dist-info. Explicitly adding /app lets Python find winnow/__init__.py there.
|
||||||
|
ENV HF_HOME=/models/huggingface INSIGHTFACE_HOME=/models/.insightface PYTHONPATH=/app
|
||||||
|
|
||||||
HEALTHCHECK CMD test -f /app/entrypoint.sh || exit 1
|
HEALTHCHECK CMD test -f /app/entrypoint.sh || exit 1
|
||||||
ENTRYPOINT ["tini", "--", "/app/entrypoint.sh"]
|
ENTRYPOINT ["tini", "--", "/app/entrypoint.sh"]
|
||||||
|
|||||||
Reference in New Issue
Block a user