Merge python-docx into main
Continuous Integration / Test Suite (macos-latest, nightly) (push) Has been cancelled
Continuous Integration / Test Suite (macos-latest, stable) (push) Has been cancelled
Continuous Integration / Test Suite (ubuntu-latest, 1.70.0) (push) Has been cancelled
Continuous Integration / Test Suite (ubuntu-latest, beta) (push) Has been cancelled
Continuous Integration / Test Suite (ubuntu-latest, nightly) (push) Has been cancelled
Continuous Integration / Test Suite (ubuntu-latest, stable) (push) Has been cancelled
Continuous Integration / Test Suite (windows-latest, stable) (push) Has been cancelled
Continuous Integration / Security Audit (push) Has been cancelled
Continuous Integration / Code Coverage (push) Has been cancelled
Continuous Integration / Performance Benchmarks (push) Has been cancelled
Continuous Integration / Memory Safety Check (push) Has been cancelled
Continuous Integration / Docker Build Test (push) Has been cancelled
Continuous Integration / Release Readiness (push) Has been cancelled
Continuous Integration / Integration Tests (push) Has been cancelled
Continuous Integration / Stress Testing (push) Has been cancelled
Continuous Integration / Notify Results (push) Has been cancelled
Continuous Integration / Test Suite (macos-latest, nightly) (push) Has been cancelled
Continuous Integration / Test Suite (macos-latest, stable) (push) Has been cancelled
Continuous Integration / Test Suite (ubuntu-latest, 1.70.0) (push) Has been cancelled
Continuous Integration / Test Suite (ubuntu-latest, beta) (push) Has been cancelled
Continuous Integration / Test Suite (ubuntu-latest, nightly) (push) Has been cancelled
Continuous Integration / Test Suite (ubuntu-latest, stable) (push) Has been cancelled
Continuous Integration / Test Suite (windows-latest, stable) (push) Has been cancelled
Continuous Integration / Security Audit (push) Has been cancelled
Continuous Integration / Code Coverage (push) Has been cancelled
Continuous Integration / Performance Benchmarks (push) Has been cancelled
Continuous Integration / Memory Safety Check (push) Has been cancelled
Continuous Integration / Docker Build Test (push) Has been cancelled
Continuous Integration / Release Readiness (push) Has been cancelled
Continuous Integration / Integration Tests (push) Has been cancelled
Continuous Integration / Stress Testing (push) Has been cancelled
Continuous Integration / Notify Results (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,70 @@
|
||||
# Dockerfile for py-docx-mcp (Python MCP server) - OpenWebUI: MCP (Streamable HTTP)
|
||||
# Usage:
|
||||
# docker build -t py-docx-mcp -f py-docx/Dockerfile .
|
||||
# docker run --rm -p 3000:3000 py-docx-mcp
|
||||
#
|
||||
# In OpenWebUI:
|
||||
# - Type: MCP (Streamable HTTP)
|
||||
# - URL: http://<host>:3000
|
||||
# - Auth: Bearer (if DOCX_MCP_API_KEY is set)
|
||||
#
|
||||
# Environment:
|
||||
# DOCX_MCP_API_KEY - API key (Bearer or X-API-Key). Optional but recommended.
|
||||
# DOCX_MCP_HTTP_HOST - Bind host (default: 0.0.0.0)
|
||||
# DOCX_MCP_HTTP_PORT - Bind port (default: 3000)
|
||||
# DOCX_MCP_TEMPLATES_DIR - Templates directory (default: /templates)
|
||||
# DOCX_MCP_MAX_SIZE - Max document size in bytes (default: 104857600)
|
||||
# DOCX_MCP_MAX_DOCS - Max open documents (default: 30)
|
||||
# DOCX_MCP_SANDBOX - Enable sandbox mode (default: true)
|
||||
# DOCX_MCP_ALLOW_EXTERNAL_TOOLS - Allow external tools (default: false)
|
||||
# DOCX_MCP_ALLOW_NETWORK - Allow network access (default: false)
|
||||
|
||||
FROM python:3.12-slim AS base
|
||||
|
||||
ENV PYTHONDONTWRITEBYTECODE=1 \
|
||||
PYTHONUNBUFFERED=1 \
|
||||
PIP_NO_CACHE_DIR=off \
|
||||
PIP_DISABLE_PIP_VERSION_CHECK=1
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# System deps (for python-docx, Pillow, and optional external converters)
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
build-essential \
|
||||
libjpeg62-turbo-dev \
|
||||
libpng-dev \
|
||||
libfreetype6-dev \
|
||||
libfontconfig1-dev \
|
||||
libreoffice \
|
||||
poppler-utils \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install Python dependencies
|
||||
COPY py-docx/pyproject.toml ./
|
||||
RUN pip install --upgrade pip && pip install .
|
||||
|
||||
# Copy source
|
||||
COPY py-docx/src/py_docx ./src/py_docx
|
||||
|
||||
# Create runtime dirs
|
||||
RUN mkdir -p /templates /out /tmp/py-docx-mcp
|
||||
|
||||
# Environment
|
||||
ENV DOCX_MCP_HTTP_HOST=0.0.0.0 \
|
||||
DOCX_MCP_HTTP_PORT=3000 \
|
||||
DOCX_MCP_TEMPLATES_DIR=/templates \
|
||||
DOCX_MCP_MAX_SIZE=104857600 \
|
||||
DOCX_MCP_MAX_DOCS=30 \
|
||||
DOCX_MCP_SANDBOX=true \
|
||||
DOCX_MCP_ALLOW_EXTERNAL_TOOLS=true \
|
||||
DOCX_MCP_ALLOW_NETWORK=false
|
||||
|
||||
# Expose HTTP port (Streamable HTTP for OpenWebUI)
|
||||
EXPOSE 3000
|
||||
|
||||
# Health check (ensure module is importable)
|
||||
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \
|
||||
CMD python -c "import py_docx.server; print('ok')" || exit 1
|
||||
|
||||
# Default: Streamable HTTP for OpenWebUI MCP
|
||||
ENTRYPOINT ["python", "-m", "py_docx.server"]
|
||||
Reference in New Issue
Block a user