codebertBase / Dockerfile
Forrest99's picture
Update Dockerfile
48ea984 verified
raw
history blame
514 Bytes
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"]