Spaces:
Running
Running
FROM python:3.12 | |
# 创建一个非根用户 | |
RUN useradd -m appuser | |
WORKDIR /app | |
COPY . . | |
# 更改工作目录的所有者为新用户 | |
RUN chown -R appuser:appuser /app | |
# 安装必要的库 | |
RUN apt-get update && apt-get install -y libgl1 | |
# 设置 Hugging Face 缓存目录 | |
ENV HF_HOME="/app/hf_cache" | |
# 安装 Python 包 | |
RUN pip install . | |
# 切换到非根用户 | |
USER appuser | |
EXPOSE 7860 | |
ENV PYTHONUNBUFFERED=1 | |
CMD ["pdf2zh", "-i"] |