Spaces:
Running
Running
# 使用 Python 3.9 作为基础镜像 | |
FROM python:3.9 | |
# 添加用户 | |
RUN useradd -m -u 1000 user | |
# 设置工作目录 | |
WORKDIR /app | |
# 切换到 root 用户以安装系统依赖 | |
USER root | |
RUN apt-get update && apt-get install -y rubberband-cli | |
# 切回到普通用户 | |
USER user | |
ENV PATH="/home/user/.local/bin:$PATH" | |
# 复制并安装 Python 依赖 | |
COPY --chown=user ./requirements.txt requirements.txt | |
RUN pip install --no-cache-dir --upgrade -r requirements.txt | |
# 复制应用文件 | |
COPY --chown=user . /app | |
# 启动 Gradio 应用,假设应用入口文件为 app.py | |
# CMD ["python", "app.py"] | |
CMD ["python", "app_chat.py"] | |