HongshengY commited on
Commit
ae69782
·
verified ·
1 Parent(s): e41946e

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -5
Dockerfile CHANGED
@@ -1,13 +1,17 @@
1
- FROM python:3.11-slim
 
2
 
 
3
  WORKDIR /app
4
 
 
5
  RUN apt-get update && apt-get install -y \
6
  git \
7
- libgl1-mesa-glx \
8
  libglib2.0-0 \
9
  && rm -rf /var/lib/apt/lists/*
10
 
 
11
  RUN pip install --no-cache-dir \
12
  huggingface_hub \
13
  fastapi \
@@ -17,11 +21,14 @@ RUN pip install --no-cache-dir \
17
  scipy \
18
  scikit-image \
19
  trimesh \
20
- onnxruntime
21
- # 如果你是 GPU Space,上面最后一行改成 onnxruntime-gpu
22
 
 
23
  RUN mkdir -p /app/runs && chmod 777 /app/runs
24
 
25
- COPY loader.py /app/loader.py
 
 
26
 
 
27
  CMD ["python", "loader.py"]
 
1
+ # 使用 Python 3.9
2
+ FROM python:3.9-slim
3
 
4
+ # 设置工作目录
5
  WORKDIR /app
6
 
7
+ # 1. 安装系统级依赖 (已包含 libgl1 修复)
8
  RUN apt-get update && apt-get install -y \
9
  git \
10
+ libgl1 \
11
  libglib2.0-0 \
12
  && rm -rf /var/lib/apt/lists/*
13
 
14
+ # 2. 安装 Python 依赖
15
  RUN pip install --no-cache-dir \
16
  huggingface_hub \
17
  fastapi \
 
21
  scipy \
22
  scikit-image \
23
  trimesh \
24
+ onnxruntime
 
25
 
26
+ # 3. 创建 runs 目录
27
  RUN mkdir -p /app/runs && chmod 777 /app/runs
28
 
29
+ # 4. 【关键修改】复制当前目录下所有文件到容器
30
+ # 原来的 COPY loader.py /app/loader.py 改为下面这行:
31
+ COPY . /app
32
 
33
+ # 5. 启动
34
  CMD ["python", "loader.py"]