feat:添加Dockerfile
This commit is contained in:
		
							
								
								
									
										17
									
								
								Dockerfile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								Dockerfile
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,17 @@
 | 
			
		||||
FROM python:3.12
 | 
			
		||||
 | 
			
		||||
# 设置工作目录
 | 
			
		||||
WORKDIR /app
 | 
			
		||||
 | 
			
		||||
# 将当前目录内容复制到位于容器的/app目录下
 | 
			
		||||
COPY . /app
 | 
			
		||||
 | 
			
		||||
# 安装依赖
 | 
			
		||||
RUN pip config set global.index-url https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple
 | 
			
		||||
RUN pip install --no-cache-dir -r requirements.txt
 | 
			
		||||
 | 
			
		||||
# 暴露容器的端口
 | 
			
		||||
EXPOSE 8000
 | 
			
		||||
 | 
			
		||||
# 在容器启动时运行app.py
 | 
			
		||||
CMD ["python", "main.py"]
 | 
			
		||||
		Reference in New Issue
	
	Block a user