JamesK123 commited on
Commit
8d17ae3
·
verified ·
1 Parent(s): c8c5741

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +26 -0
Dockerfile ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # 使用官方 Python 轻量镜像
2
+ FROM python:3.10-slim
3
+
4
+ # 安装构建 llama-cpp 必需的 C++ 编译器和工具
5
+ RUN apt-get update && apt-get install -y \
6
+ build-essential \
7
+ python3-dev \
8
+ gcc \
9
+ g++ \
10
+ && rm -rf /var/lib/apt/lists/*
11
+
12
+ # 设置工作目录
13
+ WORKDIR /app
14
+
15
+ # 复制依赖文件并安装
16
+ COPY requirements.txt /app/
17
+ RUN pip install --no-cache-dir -r requirements.txt
18
+
19
+ # 复制当前目录下所有文件到容器的 /app 中
20
+ COPY . /app/
21
+
22
+ # 暴露 HF Spaces 要求的端口
23
+ EXPOSE 7860
24
+
25
+ # 启动服务
26
+ CMD ["python", "app.py"]