Spaces:
Runtime error
Runtime error
Download Dockerfile from NEXUSYYAN/PDFMathTranslate-Docker: direct link, hf CLI and curl.
- Browser
- Download file 648 Bytes
-
https://huggingface.co/spaces/NEXUSYYAN/PDFMathTranslate-Docker/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/NEXUSYYAN/PDFMathTranslate-Docker/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/NEXUSYYAN/PDFMathTranslate-Docker/resolve/main/Dockerfile
648 Bytes
| FROM python:3.12 | |
| WORKDIR /app | |
| # 设置argostranslate专用缓存路径 | |
| ENV ARGOS_TRANSLATE_PACKAGES_DIR=/app/.cache/argos-translate | |
| ENV ARGOS_TRANSLATE_DATA_DIR=/app/.cache/argos-translate | |
| ENV PYTHONUNBUFFERED=1 | |
| RUN apt-get update && apt-get install -y libgl1 \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # 创建缓存目录并设置权限 | |
| RUN mkdir -p ${ARGOS_TRANSLATE_DATA_DIR} && \ | |
| chmod 777 ${ARGOS_TRANSLATE_DATA_DIR} | |
| # 添加非root用户 | |
| RUN adduser --disabled-password --gecos "" appuser && \ | |
| chown -R appuser:appuser /app | |
| USER appuser | |
| ENV PATH="/home/appuser/.local/bin:${PATH}" | |
| RUN pip install --user pdf2zh | |
| CMD ["pdf2zh", "-i"] | |