nbugs commited on
Commit
d805d35
·
verified ·
1 Parent(s): 4db0a9d

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -29
Dockerfile CHANGED
@@ -1,37 +1,15 @@
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
  # 复制自定义文件
7
- #COPY custom.css /app/build/assets/
8
- #COPY custom.js /app/build/assets/
9
- #COPY editor.css /app/build/assets/
10
- #COPY editor.js /app/build/assets/
11
-
12
- # 替换为优化版的备份脚本
13
- COPY sync_data.sh /tmp/sync_data.sh
14
-
15
- # 创建一个启动脚本
16
- RUN echo '#!/bin/bash\n\
17
- # 启动备份服务\n\
18
- if [ -f "/tmp/sync_data.sh" ]; then\n\
19
- bash /tmp/sync_data.sh &\n\
20
- fi\n\
21
- \n\
22
- # 启动原始应用\n\
23
- exec /app/start.sh "$@"\n\
24
- ' > /app/custom_start.sh && \
25
- chmod +x /app/custom_start.sh
26
 
27
  # 修改HTML引用
28
- #RUN sed -i 's|</head>|<link rel="stylesheet" href="assets/editor.css"></link><link rel="stylesheet" href="assets/custom.css"></link></head>|' /app/build/index.html && \
29
- #sed -i 's|</body>|<script src="assets/editor.js"></script><script src="assets/custom.js"></script></body>|' /app/build/index.html
30
 
31
  # 设置权限
32
  RUN chmod -R 777 ./data && \
33
- chmod -R 777 /app/backend/open_webui/static && \
34
- chmod +x /tmp/sync_data.sh
35
-
36
- # 使用新的启动脚本
37
- ENTRYPOINT ["/app/custom_start.sh"]
 
1
  FROM ghcr.io/open-webui/open-webui:main
2
 
 
 
 
3
  # 复制自定义文件
4
+ COPY custom.css /app/build/assets/
5
+ COPY custom.js /app/build/assets/
6
+ COPY editor.css /app/build/assets/
7
+ COPY editor.js /app/build/assets/
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
 
9
  # 修改HTML引用
10
+ RUN sed -i 's|</head>|<link rel="stylesheet" href="assets/editor.css"></link><link rel="stylesheet" href="assets/custom.css"></link></head>|' /app/build/index.html && \
11
+ sed -i 's|</body>|<script src="assets/editor.js"></script><script src="assets/custom.js"></script></body>|' /app/build/index.html
12
 
13
  # 设置权限
14
  RUN chmod -R 777 ./data && \
15
+ chmod -R 777 /app/backend/open_webui/static