Spaces:
Running
Running
File size: 633 Bytes
ae1bdf7 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# 使用 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"]
|