pd2zh / Dockerfile
nbugs's picture
Update Dockerfile
cf3f022 verified
raw
history blame contribute delete
800 Bytes
FROM python:3.12
WORKDIR /app
ENV PYTHONUNBUFFERED=1
# 系统依赖
RUN apt-get update && apt-get install -y libgl1 \
&& rm -rf /var/lib/apt/lists/*
# 安装最新版本的 pdf2zh
RUN pip install --no-cache-dir --upgrade pdf2zh
# 创建必要的目录并设置权限
RUN mkdir -p /data \
&& mkdir -p /app \
&& mkdir -p /.cache \
&& mkdir -p ./gradio_files \
&& mkdir -p /.config/PDFMathTranslate \
&& chmod -R 777 /data \
&& chmod -R 777 /app \
&& chmod -R 777 /.cache \
&& chmod -R 777 ./gradio_files \
&& chmod -R 777 /.config
# 创建配置文件并添加基本配置
RUN echo '{"USE_MODELSCOPE": "0", "MODEL_CACHE_DIR": "/.cache"}' > /.config/PDFMathTranslate/config.json \
&& chmod 666 /.config/PDFMathTranslate/config.json
CMD ["pdf2zh", "-i"]