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 \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install Python dependencies
|
||||
# Copy project metadata and source before installing
|
||||
COPY pyproject.toml ./
|
||||
RUN pip install --upgrade pip && pip install .
|
||||
|
||||
# Copy source
|
||||
COPY src/py_docx ./src/py_docx
|
||||
|
||||
# Ensure py_docx is importable
|
||||
ENV PYTHONPATH="/app/src:${PYTHONPATH}"
|
||||
# Install Python dependencies (including this package)
|
||||
RUN pip install --upgrade pip && pip install .
|
||||
|
||||
# Ensure py_docx is importable at runtime
|
||||
ENV PYTHONPATH="/app/src"
|
||||
|
||||
# Create runtime dirs
|
||||
RUN mkdir -p /templates /out /tmp/py-docx-mcp
|
||||
|
||||
Reference in New Issue
Block a user