codebertBase / Dockerfile
Forrest99's picture
Update Dockerfile
867bc1e verified
raw
history blame contribute delete
573 Bytes
FROM python:3.9-slim
# 设置工作目录
WORKDIR /app
# 修复缓存目录权限
RUN mkdir -p /app/.cache/huggingface && \
chmod -R 777 /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 --chmod=644 app.py .
# 启动命令
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]