kines9661 commited on
Commit
fcb2231
·
verified ·
1 Parent(s): 47ecd62

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -8
Dockerfile CHANGED
@@ -1,29 +1,32 @@
1
- # 使用 Python 基礎映像
2
  FROM python:3.11-slim
3
 
4
- # 設定工作目錄
5
  WORKDIR /app
6
 
7
- # 安裝系統相依套件
8
  RUN apt-get update && apt-get install -y \
9
  gcc \
10
  g++ \
11
  git \
 
12
  && rm -rf /var/lib/apt/lists/*
13
 
14
- # 複製需求檔並安裝 Python 套件
 
 
 
15
  COPY requirements.txt .
16
  RUN pip install --no-cache-dir -r requirements.txt
17
 
18
- # 複製應用程式
19
  COPY . .
20
 
21
- # 建立非 root 使用者(Hugging Face Spaces 要求)
 
 
 
22
  RUN useradd -m -u 1000 user
23
  USER user
24
 
25
- # 暴露預設 Hugging Face Spaces 埠口
26
  EXPOSE 7860
27
 
28
- # 啟動 Gradio 應用
29
  CMD ["python", "app.py"]
 
 
1
  FROM python:3.11-slim
2
 
 
3
  WORKDIR /app
4
 
5
+ # 安裝系統相依
6
  RUN apt-get update && apt-get install -y \
7
  gcc \
8
  g++ \
9
  git \
10
+ git-lfs \
11
  && rm -rf /var/lib/apt/lists/*
12
 
13
+ # 啟用 git-lfs
14
+ RUN git lfs install
15
+
16
+ # 複製並安裝 Python 套件
17
  COPY requirements.txt .
18
  RUN pip install --no-cache-dir -r requirements.txt
19
 
20
+ # 複製應用程式(包含模型)
21
  COPY . .
22
 
23
+ # 檢查模型是否存在
24
+ RUN ls -la models/ 2>/dev/null || echo "No local models found"
25
+
26
+ # 建立非 root 使用者
27
  RUN useradd -m -u 1000 user
28
  USER user
29
 
 
30
  EXPOSE 7860
31
 
 
32
  CMD ["python", "app.py"]