File size: 526 Bytes
8b383ad | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | # Hugging Face 官方标准格式 —— 必须这样写
FROM python:3.11-slim
# 固定配置
RUN useradd -m -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:$PATH"
WORKDIR /app
# 安装依赖
COPY --chown=user ./requirements.txt requirements.txt
RUN pip install --no-cache-dir --upgrade -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple/
# 复制代码
COPY --chown=user . /app
# 必须端口 7860
CMD ["uvicorn", "backend.backend_app.main:app", "--host", "0.0.0.0", "--port", "7860"] |