Update Dockerfile
Browse files- Dockerfile +14 -15
Dockerfile
CHANGED
|
@@ -1,25 +1,24 @@
|
|
| 1 |
-
# 使用 Hugging Face
|
| 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 |
-
#
|
| 12 |
-
|
| 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
|
|
|
|
|
|
|
|
|
|
| 20 |
|
| 21 |
-
#
|
| 22 |
-
RUN pip install --no-cache-dir -r requirements.txt
|
| 23 |
|
| 24 |
-
#
|
| 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"]
|