Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- 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 --
|
|
|
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 .
|