Dockerfile 643 B

1234567891011121314151617181920212223242526
  1. # 使用 Python 3.7 作为基础镜像
  2. FROM python:3.7-slim
  3. # 设置工作目录
  4. WORKDIR /app
  5. # 复制 requirements.txt 到工作目录
  6. COPY requirements.txt .
  7. # 安装依赖
  8. RUN pip install --no-cache-dir -r requirements.txt -i https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple
  9. RUN apt-get update
  10. RUN apt-get install ffmpeg libsm6 libxext6 -y
  11. RUN apt-get install libgl1
  12. # 复制项目目录中的所有文件到镜像中
  13. COPY . .
  14. # 设置环境变量(如果需要)
  15. ENV PYTHONUNBUFFERED=1
  16. # 暴露服务端口(假设你的 Flask 服务运行在 5005 端口)
  17. EXPOSE 5005
  18. # 启动 Flask 服务
  19. CMD ["python", "app-service.py"]