FROM python:3.12.7-slim-bookworm

# 设置工作目录
WORKDIR /app

# 复制要求的文件
COPY . /app

# 安装依赖
RUN pip install --no-cache-dir -r requirements.txt

# 设置环境变量
ENV FLASK_APP=main.py

ENV PYTHONUNBUFFERED=1

EXPOSE 5000

# 启动 Flask 应用
CMD ["flask", "run", "--host=0.0.0.0"]
#CMD ["gunicorn", "--bind", "0.0.0.0:5000", "main:app"]
