MinerUapi / Dockerfile
kitjesen's picture
Upload Dockerfile
e7e01d1 verified
raw
history blame contribute delete
865 Bytes
FROM python:3.9-slim
WORKDIR /app
# 安装系统依赖
RUN apt-get update && apt-get install -y \
build-essential \
libpq-dev \
tesseract-ocr \
poppler-utils \
git \
&& rm -rf /var/lib/apt/lists/*
# 克隆 MinerU 项目并安装
RUN git clone https://github.com/opendatalab/MinerU.git /tmp/MinerU \
&& cd /tmp/MinerU \
&& pip install -e . \
&& cp -r /tmp/MinerU/magic_pdf /app/magic_pdf \
&& rm -rf /tmp/MinerU
# 复制必要文件
COPY requirements.txt .
COPY app.py .
COPY download_models.py .
# 安装 Python 依赖
RUN pip install --no-cache-dir -r requirements.txt
# 下载模型
RUN python download_models.py
# 设置环境变量
ENV PORT=7860
ENV PYTHONPATH=/app:$PYTHONPATH
# 启动应用
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"]