diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..74c1399 --- /dev/null +++ b/Dockerfile @@ -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"]