xjf6b commited on
Commit
869ebef
·
verified ·
1 Parent(s): bb36c60

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +4 -7
Dockerfile CHANGED
@@ -1,7 +1,7 @@
1
  FROM python:3.9-slim
2
 
3
  # 安装必要的依赖
4
- RUN apt-get update && apt-get install -y git cron
5
 
6
  # 创建一个非 root 用户
7
  RUN useradd -m appuser
@@ -13,6 +13,7 @@ RUN chown appuser:appuser /app
13
  # 复制必要的文件
14
  COPY merged2upload.py /app/merged2upload.py
15
  COPY entrypoint.sh /app/entrypoint.sh
 
16
 
17
  # 设置执行权限
18
  RUN chmod +x /app/entrypoint.sh
@@ -21,7 +22,7 @@ RUN chmod +x /app/entrypoint.sh
21
  USER appuser
22
 
23
  # 安装Python依赖
24
- RUN pip install --user requests PyYAML tqdm
25
 
26
  # 设置环境变量(这些将在HuggingFace后台设置)
27
  ENV GITHUB_TOKEN=""
@@ -30,12 +31,8 @@ ENV PROXY=""
30
  ENV GIT_CLONE_PROXY=""
31
  ENV PATH="/home/appuser/.local/bin:${PATH}"
32
 
33
- # 设置 cron 任务
34
- RUN echo "0 */6 * * * /app/entrypoint.sh run_script >> /app/cron.log 2>&1" | crontab -
35
-
36
  # 暴露8080端口
37
  EXPOSE 8080
38
 
39
  # 设置入口点
40
- ENTRYPOINT ["/app/entrypoint.sh"]
41
- CMD ["start"]
 
1
  FROM python:3.9-slim
2
 
3
  # 安装必要的依赖
4
+ RUN apt-get update && apt-get install -y git
5
 
6
  # 创建一个非 root 用户
7
  RUN useradd -m appuser
 
13
  # 复制必要的文件
14
  COPY merged2upload.py /app/merged2upload.py
15
  COPY entrypoint.sh /app/entrypoint.sh
16
+ COPY scheduler.py /app/scheduler.py
17
 
18
  # 设置执行权限
19
  RUN chmod +x /app/entrypoint.sh
 
22
  USER appuser
23
 
24
  # 安装Python依赖
25
+ RUN pip install --user requests PyYAML tqdm schedule
26
 
27
  # 设置环境变量(这些将在HuggingFace后台设置)
28
  ENV GITHUB_TOKEN=""
 
31
  ENV GIT_CLONE_PROXY=""
32
  ENV PATH="/home/appuser/.local/bin:${PATH}"
33
 
 
 
 
34
  # 暴露8080端口
35
  EXPOSE 8080
36
 
37
  # 设置入口点
38
+ ENTRYPOINT ["/app/entrypoint.sh"]