FROM python:3.11-slim

WORKDIR /rootPath

RUN apt-get update && apt-get install -y \
    build-essential \
    libjpeg-dev \
    zlib1g-dev \
    libpng-dev \
    libxml2-dev \
    libxslt1-dev \
    && rm -rf /var/lib/apt/lists/*

RUN pip install --no-cache-dir \
    requests \
    python-docx \
    python-pptx \
    openpyxl \
    reportlab \
    beautifulsoup4 \
    markdown2 \
    emoji \
    py7zr \
    uvicorn \
    starlette \
    pillow \
    mcp[fastmcp]

COPY config.json /rootPath
COPY tools /rootPath/tools
COPY templates /rootPath/templates
COPY functions /rootPath/functions

RUN mkdir -p /rootPath/output

EXPOSE 9004

CMD ["python", "/rootPath/tools/file_export_mcp.py", "--no-color"]
