feat:添加Dockerfile

This commit is contained in:
Gzs2406 2025-01-03 15:41:14 +08:00
parent 67627c1c66
commit 400503455b

17
Dockerfile Normal file
View 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"]