Fix Dockerfile: copy src before pip install; set PYTHONPATH

This commit is contained in:
2026-06-13 15:49:07 +00:00
parent 8adb8c8fb0
commit af8f6bf2e1
+6 -6
View File
@@ -39,15 +39,15 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
poppler-utils \ poppler-utils \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
# Install Python dependencies # Copy project metadata and source before installing
COPY pyproject.toml ./ COPY pyproject.toml ./
RUN pip install --upgrade pip && pip install .
# Copy source
COPY src/py_docx ./src/py_docx COPY src/py_docx ./src/py_docx
# Ensure py_docx is importable # Install Python dependencies (including this package)
ENV PYTHONPATH="/app/src:${PYTHONPATH}" RUN pip install --upgrade pip && pip install .
# Ensure py_docx is importable at runtime
ENV PYTHONPATH="/app/src"
# Create runtime dirs # Create runtime dirs
RUN mkdir -p /templates /out /tmp/py-docx-mcp RUN mkdir -p /templates /out /tmp/py-docx-mcp