Songyou commited on
Commit
e50a72f
·
verified ·
1 Parent(s): fbe9c7c

Create dockerfile

Browse files
Files changed (1) hide show
  1. dockerfile +17 -0
dockerfile ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # 使用官方 Python 3.8 基础镜像
2
+ FROM python:3.8-slim
3
+
4
+ # 设置工作目录
5
+ WORKDIR /app
6
+
7
+ # 复制当前目录中的所有文件到容器内
8
+ COPY . /app
9
+
10
+ # 安装应用的依赖
11
+ RUN pip install --no-cache-dir -r requirements.txt
12
+
13
+ # 开放端口 8000
14
+ EXPOSE 8000
15
+
16
+ # 启动 FastAPI 应用
17
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]