XiaoyiYangRIT commited on
Commit
fa1d0a3
·
1 Parent(s): 5c0e42d

Add custom Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +23 -0
Dockerfile ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # 使用 CUDA 和 cuDNN 的基础镜像(支持 flash-attn 编译)
2
+ FROM nvidia/cuda:12.3.2-cudnn9-devel-ubuntu22.04
3
+
4
+ # 安装系统依赖
5
+ RUN apt-get update && apt-get install -y \
6
+ git build-essential ffmpeg libsm6 libxext6 libgl1-mesa-glx curl wget \
7
+ python3-pip python3.10-venv \
8
+ && rm -rf /var/lib/apt/lists/*
9
+
10
+ # 升级 pip
11
+ RUN pip install --upgrade pip
12
+
13
+ # 拷贝并安装 Python 依赖(不包含 flash-attn)
14
+ COPY requirements.txt /tmp/requirements.txt
15
+ RUN pip install --no-cache-dir -r /tmp/requirements.txt \
16
+ && pip install --no-cache-dir flash-attn || echo "⚠️ flash-attn 安装失败,跳过(use_flash_attn=False 时可正常运行)"
17
+
18
+ # 设置工作目录并复制全部代码
19
+ WORKDIR /home/user/app
20
+ COPY . .
21
+
22
+ # 启动 Gradio 应用(默认执行 app.py)
23
+ CMD ["python3", "app.py"]