Dockerfile 287 B

123456789101112131415
  1. FROM python:3.11-slim
  2. WORKDIR /app
  3. COPY requirements.txt .
  4. RUN pip install --no-cache-dir -r requirements.txt
  5. # 安装 gunicorn 用于生产环境运行 Flask
  6. RUN pip install --no-cache-dir gunicorn
  7. COPY . .
  8. EXPOSE 8888
  9. CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:8888", "app:app"]