Ryanus commited on
Commit
b645e95
·
verified ·
1 Parent(s): d78a253

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +14 -15
Dockerfile CHANGED
@@ -1,25 +1,24 @@
1
- # 使用 Hugging Face 提供的 CPU 基础镜像(Python 3.10)
2
  FROM huggingface/space-python3.10-cpu
3
 
4
- # -------------------------- 安装系统依赖(ffmpeg、git) --------------------------
5
  RUN apt-get update && \
6
  apt-get install -y --no-install-recommends \
7
- ffmpeg \ # 视频编解码工具(关键!)
8
- git # 用于拉取子模块(若子模块仓库需要认证,需提前配置 SSH Key)
9
  && rm -rf /var/lib/apt/lists/*
10
 
11
- # -------------------------- 初始化 Git 子模块(关键!) --------------------------
12
- # 若子模块仓库是私有仓库,需添加 SSH Key(参考 Hugging Face 文档)
13
- # 示例:使用 HTTPS 替代 SSH 避免认证问题
14
- RUN git config --global url."https://github.com".insteadOf "git@github.com:" && \
15
- git submodule init && \
16
- git submodule update --recursive # 递归初始化所有子模块
17
 
18
- # -------------------------- 复制项目代码到容器 --------------------------
19
- COPY . /app # /app 是 Hugging Face Space 的默认工作目录
 
 
 
20
 
21
- # -------------------------- 安装 Python 依赖 --------------------------
22
- RUN pip install --no-cache-dir -r requirements.txt # --no-cache 避免缓存
23
 
24
- # -------------------------- 启动命令(运行 Gradio 应用) --------------------------
25
  CMD ["python", "app.py"]
 
1
+ # 使用 Hugging Face 官方 CPU 镜像
2
  FROM huggingface/space-python3.10-cpu
3
 
4
+ # 安装系统依赖
5
  RUN apt-get update && \
6
  apt-get install -y --no-install-recommends \
7
+ ffmpeg \ # 视频处理核心工具
8
+ git # 用于拉取子模块
9
  && rm -rf /var/lib/apt/lists/*
10
 
11
+ # 配置子模块(强制 HTTPS)
12
+ RUN git config --global url."https://github.com".insteadOf "git@github.com:"
 
 
 
 
13
 
14
+ # 复制代码并初始化子模块
15
+ COPY . /app
16
+ WORKDIR /app
17
+ RUN git submodule init && \
18
+ git submodule update --recursive # 递归拉取子模块
19
 
20
+ # 安装 Python 依赖
21
+ RUN pip install --no-cache-dir -r requirements.txt
22
 
23
+ # 启动命令
24
  CMD ["python", "app.py"]