leezhuuu commited on
Commit
fefc401
1 Parent(s): bbfdcdb

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +40 -1
Dockerfile CHANGED
@@ -1,8 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  # 构建阶段
2
  FROM python:3.11 as builder
3
 
4
  WORKDIR /app
 
 
5
  COPY . /app
 
 
6
 
7
  RUN python -m venv .venv
8
  ENV PATH="/app/.venv/bin:$PATH"
@@ -16,11 +48,18 @@ RUN git clone https://huggingface.co/THUDM/glm-4-Voice-decoder
16
  FROM python:3.11-slim
17
 
18
  WORKDIR /app
 
 
19
  COPY --from=builder /app/.venv /app/.venv
20
  COPY --from=builder /app/glm-4-Voice-decoder /app/glm-4-Voice-decoder
21
- COPY --from=builder /app/web_demo.py /app/
 
 
22
 
23
  ENV PATH="/app/.venv/bin:$PATH"
 
 
 
24
  EXPOSE 8888
25
  EXPOSE 8000
26
 
 
1
+ # # 构建阶段
2
+ # FROM python:3.11 as builder
3
+
4
+ # WORKDIR /app
5
+ # COPY . /app
6
+
7
+ # RUN python -m venv .venv
8
+ # ENV PATH="/app/.venv/bin:$PATH"
9
+ # RUN pip install --upgrade pip
10
+ # RUN pip install --no-cache-dir -r requirements.txt
11
+ # RUN apt-get update && apt-get install -y git-lfs
12
+ # RUN git lfs install
13
+ # RUN git clone https://huggingface.co/THUDM/glm-4-Voice-decoder
14
+
15
+ # # 运行阶段
16
+ # FROM python:3.11-slim
17
+
18
+ # WORKDIR /app
19
+ # COPY --from=builder /app/.venv /app/.venv
20
+ # COPY --from=builder /app/glm-4-Voice-decoder /app/glm-4-Voice-decoder
21
+ # COPY --from=builder /app/web_demo.py /app/
22
+
23
+ # ENV PATH="/app/.venv/bin:$PATH"
24
+ # EXPOSE 8888
25
+ # EXPOSE 8000
26
+
27
+ # CMD sh -c "nohup .venv/bin/python model_server.py & .venv/bin/python web_demo.py"
28
+
29
  # 构建阶段
30
  FROM python:3.11 as builder
31
 
32
  WORKDIR /app
33
+
34
+ # 复制所有文件,然后显式复制 model_server.py 和 web_demo.py
35
  COPY . /app
36
+ COPY ./model_server.py /app/ # 显式复制
37
+ COPY ./web_demo.py /app/ # 显式复制
38
 
39
  RUN python -m venv .venv
40
  ENV PATH="/app/.venv/bin:$PATH"
 
48
  FROM python:3.11-slim
49
 
50
  WORKDIR /app
51
+
52
+ # 从构建阶段复制必要的文件和目录
53
  COPY --from=builder /app/.venv /app/.venv
54
  COPY --from=builder /app/glm-4-Voice-decoder /app/glm-4-Voice-decoder
55
+ COPY --from=builder /app/model_server.py /app/ # 显式复制
56
+ COPY --from=builder /app/web_demo.py /app/ # 显式复制
57
+
58
 
59
  ENV PATH="/app/.venv/bin:$PATH"
60
+ ENV TRANSFORMERS_CACHE=/app/.cache/huggingface/hub
61
+ RUN mkdir -p /app/.cache/huggingface/hub
62
+
63
  EXPOSE 8888
64
  EXPOSE 8000
65