File size: 612 Bytes
b65f39a | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | # 使用官方的 Python 3.10 镜像作为基础环境
FROM python:3.10
# 安装 ffmpeg(视频缩略图提取需要)
RUN apt-get update && \
apt-get install -y --no-install-recommends ffmpeg && \
rm -rf /var/lib/apt/lists/*
# 设置工作目录
WORKDIR /app
# 先复制 requirements.txt 并安装依赖
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# 将当前目录下的所有文件 (包括 app.py) 复制到容器的 /app 目录下
COPY . .
# 暴露抱脸要求的 7860 端口
EXPOSE 7860
# 告诉系统启动时运行哪条命令
CMD ["python", "-u", "app.py"]
|