HuggingFace0920 commited on
Commit
970d4e4
·
verified ·
1 Parent(s): a935d6d

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +21 -6
Dockerfile CHANGED
@@ -1,10 +1,25 @@
1
  FROM ghcr.io/open-webui/open-webui:main
2
 
3
- RUN apt-get update && apt-get install -y python3 python3-pip
4
- RUN pip3 install --no-cache-dir huggingface_hub
 
 
 
5
 
6
- COPY sync_data.sh sync_data.sh
 
7
 
8
- RUN chmod -R 777 ./data && \
9
- chmod -R 777 ./open_webui && \
10
- sed -i "1r sync_data.sh" ./start.sh
 
 
 
 
 
 
 
 
 
 
 
 
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"]