Spaces:
Sleeping
Sleeping
File size: 615 Bytes
c39886c d0e82df c39886c d0e82df c39886c d0e82df c39886c d0e82df c39886c d0e82df c39886c d0e82df |
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 |
FROM python:3.9-slim
# 安装 ffmpeg(在 root 用户下)
RUN apt-get update && apt-get install -y ffmpeg && rm -rf /var/lib/apt/lists/*
# 创建非 root 用户
RUN useradd -m -u 1000 user
# 切换用户 & 设置 PATH
USER user
ENV PATH="/home/user/.local/bin:$PATH"
WORKDIR /app
# 安装 Python 依赖
COPY --chown=user requirements.txt .
RUN pip install --no-cache-dir --upgrade -r requirements.txt
# 拷贝静态资源(fonts / overlay)
COPY --chown=user ./assets ./assets
# 拷贝主程序
COPY --chown=user app.py .
# 启动服务
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] |