From cad053e88fdad2362d74269fea4b0fafe36b6db0 Mon Sep 17 00:00:00 2001 From: Holden Date: Fri, 12 Jun 2026 15:44:56 +0000 Subject: [PATCH] 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 --- Dockerfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 7559306..57ba318 100644 --- a/Dockerfile +++ b/Dockerfile @@ -84,7 +84,10 @@ RUN groupadd -g 568 apps && useradd -u 568 -g apps -m -s /bin/bash appuser \ WORKDIR /app 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 ENTRYPOINT ["tini", "--", "/app/entrypoint.sh"]