han145 commited on
Commit
eb476b0
·
verified ·
1 Parent(s): 6887add

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +19 -0
Dockerfile ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.9-slim
2
+
3
+ WORKDIR /code
4
+
5
+ COPY ./requirements.txt /code/requirements.txt
6
+
7
+ # 安装编译工具(部分 llama-cpp 环境依赖)与 Python 库
8
+ RUN apt-get update && apt-get install -y build-essential && \
9
+ pip install --no-cache-dir --upgrade -r /code/requirements.txt && \
10
+ apt-get purge -y --auto-remove build-essential && rm -rf /var/lib/apt/lists/*
11
+
12
+ COPY . .
13
+
14
+ # 启用高带宽下载支持
15
+ ENV HF_HUB_ENABLE_HF_TRANSFER=1
16
+
17
+ EXPOSE 7860
18
+
19
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]