Lowking commited on
Commit
fc203a3
·
verified ·
1 Parent(s): e8136e1

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +4 -3
Dockerfile CHANGED
@@ -8,8 +8,9 @@ WORKDIR /code
8
  COPY ./requirements.txt /code/requirements.txt
9
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
10
 
11
- # 複製其餘程式碼
12
  COPY . .
13
 
14
- # 啟動伺服器 (注意:HF 規定 Port 必須是 7860)
15
- CMD ["uvicorn", "main.py", "--host", "0.0.0.0", "--port", "7860"]
 
 
8
  COPY ./requirements.txt /code/requirements.txt
9
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
10
 
11
+ # 複製其餘程式碼 (包含 main.py)
12
  COPY . .
13
 
14
+ # ✨ 關鍵修正:將 "main.py" 改為 "main:app"
15
+ # "main" 代表檔案 main.py,"app" 代表您在程式裡寫的 app = FastAPI()
16
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]