Spaces:
Running
Running
File size: 514 Bytes
e982705 48ea984 f1f2ca1 e982705 48ea984 f1f2ca1 48ea984 e982705 7efcb5c e982705 f1f2ca1 e982705 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
FROM python:3.9-slim
# 修复缓存目录权限
RUN mkdir -p /app/.cache/huggingface && \
chmod 777 -R /app
# 安装系统依赖(必需)
RUN apt-get update && \
apt-get install -y --no-install-recommends gcc python3-dev && \
rm -rf /var/lib/apt/lists/*
# 安装Python依赖
COPY requirements.txt .
RUN pip install --upgrade pip && \
pip install --no-cache-dir -r requirements.txt
# 复制代码
COPY app.py .
# 启动命令
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] |