Spaces:
Paused
Paused
Update Dockerfile
Browse files- Dockerfile +21 -6
Dockerfile
CHANGED
|
@@ -1,10 +1,25 @@
|
|
| 1 |
FROM ghcr.io/open-webui/open-webui:main
|
| 2 |
|
| 3 |
-
|
| 4 |
-
RUN
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
-
|
|
|
|
| 7 |
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
FROM ghcr.io/open-webui/open-webui:main
|
| 2 |
|
| 3 |
+
# 安装必要的依赖
|
| 4 |
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 5 |
+
python3 python3-pip && \
|
| 6 |
+
pip3 install --no-cache-dir huggingface_hub && \
|
| 7 |
+
rm -rf /var/lib/apt/lists/*
|
| 8 |
|
| 9 |
+
# 确保虚拟环境激活脚本有执行权限
|
| 10 |
+
RUN chmod +x $HOME/venv/bin/activate
|
| 11 |
|
| 12 |
+
# 创建应用目录并设置权限
|
| 13 |
+
RUN mkdir -p /app/data /app && chmod -R 777 /app
|
| 14 |
+
|
| 15 |
+
# 添加同步脚本
|
| 16 |
+
COPY sync_data.sh /app/sync_data.sh
|
| 17 |
+
RUN chmod +x /app/sync_data.sh
|
| 18 |
+
|
| 19 |
+
# 设置启动命令
|
| 20 |
+
RUN echo "#!/bin/sh" > /app/start_with_sync.sh && \
|
| 21 |
+
echo "/app/sync_data.sh &" >> /app/start_with_sync.sh && \
|
| 22 |
+
echo "exec /app/start.sh" >> /app/start_with_sync.sh && \
|
| 23 |
+
chmod +x /app/start_with_sync.sh
|
| 24 |
+
|
| 25 |
+
CMD ["/app/start_with_sync.sh"]
|