# 使用轻量级的 Python 3.10 基础镜像 FROM python:3.10-slim # 设置工作目录 WORKDIR /app # 复制依赖列表并安装 COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # 复制所有代码文件到容器中 COPY . . # 暴露 Hugging Face Docker 默认监听的端口 EXPOSE 7860 # 启动 Streamlit,并强制将其绑定到 7860 端口和 0.0.0.0 地址 CMD ["streamlit", "run", "app.py", "--server.port", "7860", "--server.address", "0.0.0.0"]