python脚本

This commit is contained in:
ageer
2025-03-15 12:06:35 +08:00
committed by jiahao.he@vtradex.com
parent 87be1f637c
commit fe62ae4d5e
4 changed files with 141 additions and 1 deletions

View File

@@ -0,0 +1,21 @@
# 使用官方 Python 作为基础镜像
FROM python:3.8-slim
# 设置工作目录为 /app
WORKDIR /app
# 复制当前目录下的所有文件到 Docker 容器的 /app 目录
COPY . /app
# 安装应用依赖
RUN pip install --no-cache-dir -r requirements.txt
# 暴露 Flask 应用使用的端口
EXPOSE 5000
# 设置环境变量
ENV FLASK_APP=app.py
ENV FLASK_RUN_HOST=0.0.0.0
# 启动 Flask 应用
CMD ["flask", "run", "--host=0.0.0.0"]