Fix Dockerfile: copy src before pip install; set PYTHONPATH
This commit is contained in:
+6
-6
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user