99i commited on
Commit
a26f283
·
verified ·
1 Parent(s): 7acc049

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +17 -0
Dockerfile ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # 使用官方的Python 3.9镜像作为基础镜像
2
+ FROM python:3.9
3
+
4
+ # 设置工作目录
5
+ WORKDIR /app
6
+
7
+ # 将当前目录下的所有文件复制到工作目录中
8
+ COPY . .
9
+
10
+ # 安装依赖
11
+ RUN pip install -r requirements.txt
12
+
13
+ # 暴露端口
14
+ EXPOSE 8000
15
+
16
+ # 运行FastAPI应用
17
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]