exable324 commited on
Commit
85a720b
·
verified ·
1 Parent(s): 0c0540c

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -2
Dockerfile CHANGED
@@ -22,9 +22,17 @@
22
  #CMD ["npm", "start"]
23
 
24
  FROM python:3.9
 
25
  WORKDIR /code
 
 
26
  COPY ./requirements.txt /code/requirements.txt
27
- RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
 
 
 
 
28
  COPY . .
29
- # HF Spaces 默认端口是 7860
 
30
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
22
  #CMD ["npm", "start"]
23
 
24
  FROM python:3.9
25
+
26
  WORKDIR /code
27
+
28
+ # 先复制依赖文件
29
  COPY ./requirements.txt /code/requirements.txt
30
+
31
+ # 使用 --no-cache-dir 确保拉取的是我们指定的版本,而不是缓存的错误版本
32
+ RUN pip install --no-cache-dir -r /code/requirements.txt
33
+
34
+ # 复制其余代码
35
  COPY . .
36
+
37
+ # 启动命令 (确保是 app:app)
38
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]