Spaces:
Running
Running
FROM python:3.9-slim | |
# 安装必要的依赖 | |
RUN apt-get update && apt-get install -y git | |
# 创建一个非 root 用户 | |
RUN useradd -m appuser | |
# 创建工作目录并设置权限 | |
WORKDIR /app | |
RUN chown appuser:appuser /app | |
# 复制所有必要的文件和文件夹 | |
COPY . /app | |
# 设置执行权限 | |
RUN chmod +x /app/entrypoint.sh | |
# 切换到非 root 用户 | |
USER appuser | |
# 安装Python依赖 | |
RUN pip install --user requests PyYAML tqdm schedule | |
# 设置环境变量(这些将在HuggingFace后台设置) | |
ENV GITHUB_TOKEN="" | |
ENV GITHUB_GIST_ID="" | |
ENV PROXY="" | |
ENV GIT_CLONE_PROXY="" | |
ENV PATH="/home/appuser/.local/bin:${PATH}" | |
# 暴露8080端口 | |
EXPOSE 8080 | |
# 设置入口点 | |
ENTRYPOINT ["/app/entrypoint.sh"] |