fix: correct Python venv path in production Dockerfile to match OCR worker lookup logic (.venv inside ocr-worker dir)
This commit is contained in:
@@ -49,9 +49,9 @@ RUN --mount=type=cache,target=/ms-playwright-cache,sharing=locked \
|
||||
# --- Python venv for OCR worker ---
|
||||
# Use a virtual environment instead of --break-system-packages
|
||||
COPY apps/backend/subservices/ocr-worker/ ./subservices/ocr-worker/
|
||||
RUN python3 -m venv /app/venv \
|
||||
&& /app/venv/bin/pip install --no-cache-dir -U pip \
|
||||
&& /app/venv/bin/pip install --no-cache-dir ./subservices/ocr-worker
|
||||
RUN python3 -m venv /app/subservices/ocr-worker/.venv \
|
||||
&& /app/subservices/ocr-worker/.venv/bin/pip install --no-cache-dir -U pip \
|
||||
&& /app/subservices/ocr-worker/.venv/bin/pip install --no-cache-dir ./subservices/ocr-worker
|
||||
|
||||
# --- Copy application source ---
|
||||
COPY apps/backend/ ./
|
||||
@@ -101,9 +101,10 @@ COPY --from=builder /app/src ./src
|
||||
COPY --from=builder /app/config ./config
|
||||
# Playwright browsers
|
||||
COPY --from=builder /ms-playwright /ms-playwright
|
||||
# Python venv for OCR worker
|
||||
COPY --from=builder /app/venv ./venv
|
||||
COPY --from=builder /app/subservices ./subservices
|
||||
# Python venv for OCR worker (located at .venv inside subservices/ocr-worker)
|
||||
COPY --from=builder /app/subservices/ocr-worker/.venv ./subservices/ocr-worker/.venv
|
||||
COPY --from=builder /app/subservices/ocr-worker/src ./subservices/ocr-worker/src
|
||||
COPY --from=builder /app/subservices/ocr-worker/pyproject.toml ./subservices/ocr-worker/pyproject.toml
|
||||
|
||||
# --- Non-root user for security ---
|
||||
RUN groupadd -g 1001 appuser \
|
||||
|
||||
Reference in New Issue
Block a user