Forrest99 commited on
Commit
48ea984
·
verified ·
1 Parent(s): 934ae2e

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +4 -3
Dockerfile CHANGED
@@ -1,17 +1,18 @@
1
  FROM python:3.9-slim
2
 
3
- # 修复权限问题(关键步骤)
4
  RUN mkdir -p /app/.cache/huggingface && \
5
  chmod 777 -R /app
6
 
7
- # 安装系统依赖
8
  RUN apt-get update && \
9
  apt-get install -y --no-install-recommends gcc python3-dev && \
10
  rm -rf /var/lib/apt/lists/*
11
 
12
  # 安装Python依赖
13
  COPY requirements.txt .
14
- RUN pip install --no-cache-dir -r requirements.txt
 
15
 
16
  # 复制代码
17
  COPY app.py .
 
1
  FROM python:3.9-slim
2
 
3
+ # 修复缓存目录权限
4
  RUN mkdir -p /app/.cache/huggingface && \
5
  chmod 777 -R /app
6
 
7
+ # 安装系统依赖(必需)
8
  RUN apt-get update && \
9
  apt-get install -y --no-install-recommends gcc python3-dev && \
10
  rm -rf /var/lib/apt/lists/*
11
 
12
  # 安装Python依赖
13
  COPY requirements.txt .
14
+ RUN pip install --upgrade pip && \
15
+ pip install --no-cache-dir -r requirements.txt
16
 
17
  # 复制代码
18
  COPY app.py .