Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +6 -6
Dockerfile
CHANGED
|
@@ -10,18 +10,18 @@ RUN apt-get update && \
|
|
| 10 |
curl \
|
| 11 |
&& rm -rf /var/lib/apt/lists/*
|
| 12 |
|
| 13 |
-
# 2.
|
| 14 |
-
RUN mkdir -p /app/flask_session && \
|
| 15 |
-
chmod 777 /app/flask_session
|
| 16 |
-
|
| 17 |
-
# 3. 升级pip
|
| 18 |
RUN pip install --upgrade pip
|
| 19 |
|
| 20 |
-
#
|
| 21 |
RUN --mount=type=secret,id=GITHUB_TOKEN,required=true \
|
| 22 |
git clone https://x-access-token:$(cat /run/secrets/GITHUB_TOKEN)@github.com/leoncool23/difybackend.git . \
|
| 23 |
&& chmod -R 777 /app
|
| 24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
# 5. 安装Python依赖
|
| 26 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 27 |
|
|
|
|
| 10 |
curl \
|
| 11 |
&& rm -rf /var/lib/apt/lists/*
|
| 12 |
|
| 13 |
+
# 2. 升级pip
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
RUN pip install --upgrade pip
|
| 15 |
|
| 16 |
+
# 3. 使用secret挂载方式安全地克隆私有仓库
|
| 17 |
RUN --mount=type=secret,id=GITHUB_TOKEN,required=true \
|
| 18 |
git clone https://x-access-token:$(cat /run/secrets/GITHUB_TOKEN)@github.com/leoncool23/difybackend.git . \
|
| 19 |
&& chmod -R 777 /app
|
| 20 |
|
| 21 |
+
# 4. 创建应用目录下的会话目录并设置权限
|
| 22 |
+
RUN mkdir -p /app/flask_session && \
|
| 23 |
+
chmod 777 /app/flask_session
|
| 24 |
+
|
| 25 |
# 5. 安装Python依赖
|
| 26 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 27 |
|