Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +39 -11
Dockerfile
CHANGED
@@ -1,20 +1,48 @@
|
|
1 |
-
FROM python:3.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
-
# 设置工作目录
|
4 |
-
WORKDIR /app
|
5 |
|
6 |
-
#
|
|
|
|
|
|
|
7 |
COPY . /app
|
8 |
|
9 |
-
|
|
|
|
|
|
|
10 |
RUN pip install --no-cache-dir -r requirements.txt
|
11 |
-
|
12 |
-
# 下载模型 (由于模型很大,建议使用 Git LFS)
|
13 |
RUN git lfs install
|
14 |
RUN git clone https://huggingface.co/THUDM/glm-4-Voice-decode
|
15 |
|
16 |
-
#
|
17 |
-
|
18 |
|
19 |
-
|
20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# FROM python:3.11
|
2 |
+
|
3 |
+
# # 设置工作目录
|
4 |
+
# WORKDIR /app
|
5 |
+
|
6 |
+
# # 复制项目文件
|
7 |
+
# COPY . /app
|
8 |
+
|
9 |
+
# # 安装依赖
|
10 |
+
# RUN pip install --no-cache-dir -r requirements.txt
|
11 |
+
|
12 |
+
# # 下载模型 (由于模型很大,建议使用 Git LFS)
|
13 |
+
# RUN git lfs install
|
14 |
+
# RUN git clone https://huggingface.co/THUDM/glm-4-Voice-decode
|
15 |
+
|
16 |
+
# # 暴露端口
|
17 |
+
# EXPOSE 8888
|
18 |
+
|
19 |
+
# # 启动命令
|
20 |
+
# CMD ["python", "web_demo.py"]
|
21 |
|
|
|
|
|
22 |
|
23 |
+
# 构建阶段
|
24 |
+
FROM python:3.12 as builder
|
25 |
+
|
26 |
+
WORKDIR /app
|
27 |
COPY . /app
|
28 |
|
29 |
+
RUN python -m venv .venv
|
30 |
+
ENV PATH="/app/.venv/bin:$PATH"
|
31 |
+
RUN pip install --upgrade pip
|
32 |
+
RUN pip install --no-cache-dir distutils
|
33 |
RUN pip install --no-cache-dir -r requirements.txt
|
34 |
+
RUN apt-get update && apt-get install -y git-lfs
|
|
|
35 |
RUN git lfs install
|
36 |
RUN git clone https://huggingface.co/THUDM/glm-4-Voice-decode
|
37 |
|
38 |
+
# 运行阶段
|
39 |
+
FROM python:3.12-slim
|
40 |
|
41 |
+
WORKDIR /app
|
42 |
+
COPY --from=builder /app/.venv /app/.venv
|
43 |
+
COPY --from=builder /app/glm-4-Voice-decode /app/glm-4-Voice-decode
|
44 |
+
COPY --from=builder /app/web_demo.py /app/
|
45 |
+
|
46 |
+
ENV PATH="/app/.venv/bin:$PATH"
|
47 |
+
EXPOSE 8888
|
48 |
+
CMD [".venv/bin/python", "web_demo.py"]
|