HuggingFace0920 commited on
Commit
9728c75
·
verified ·
1 Parent(s): edcdd23

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +21 -7
Dockerfile CHANGED
@@ -1,14 +1,28 @@
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
- WORKDIR /app
 
 
 
 
 
 
 
 
 
 
 
 
 
7
 
8
- COPY sync_data.sh sync_data.sh
 
9
 
10
- RUN chmod +x $HOME && \
11
- chmod -R 777 ./data && \
12
- chmod -R 777 ./open_webui && \
13
- chmod +x sync_data.sh && \
14
- 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 python3 python3-pip
5
+
6
+ # 安装 huggingface_hub 库
7
  RUN pip3 install --no-cache-dir huggingface_hub
8
 
9
+ # 设置必要的环境变量(根据实际需求调整)
10
+ ENV HF_HOME="/app/data/huggingface"
11
+ ENV HUGGINGFACE_HUB_CACHE="/app/data/huggingface"
12
+
13
+ # 复制同步数据脚本
14
+ COPY sync_data.sh /app/
15
+
16
+ # 设置权限
17
+ RUN chmod -R 777 /app/data && \
18
+ chmod -R 777 /app/open_webui && \
19
+ chmod +x /app/sync_data.sh
20
+
21
+ # 修改启动脚本,确保同步脚本在启动时执行
22
+ RUN sed -i "1r /app/sync_data.sh" /app/start.sh
23
 
24
+ # 暴露端口(根据应用需求调整)
25
+ EXPOSE 3000
26
 
27
+ # 启动应用
28
+ CMD ["/app/start.sh"]