Spaces:
zx2323
/
Runtime error

zx2323 commited on
Commit
bf52bec
·
verified ·
1 Parent(s): c236ddd

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +23 -5
Dockerfile CHANGED
@@ -1,9 +1,27 @@
1
  FROM ghcr.io/open-webui/open-webui:main
2
 
3
- COPY sync_data.sh sync_data.sh
 
4
 
5
- # 安装 xmlstarlet
6
- RUN apt-get update && apt-get install -y xmlstarlet
 
7
 
8
- RUN chmod -R 777 ./data && \
9
- 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 xmlstarlet nginx
5
 
6
+ # 创建 Nginx 缓存目录
7
+ RUN mkdir -p /var/cache/nginx && \
8
+ chmod -R 777 /var/cache/nginx
9
 
10
+ # 复制 Nginx 配置文件
11
+ COPY nginx.conf /etc/nginx/nginx.conf
12
+
13
+ # 复制同步脚本
14
+ COPY sync_data.sh /sync_data.sh
15
+
16
+ # 设置权限
17
+ RUN chmod +x /sync_data.sh && \
18
+ chmod -R 777 /data
19
+
20
+ # 将同步脚本插入到启动脚本中
21
+ RUN sed -i "1r /sync_data.sh" /start.sh
22
+
23
+ # 暴露端口
24
+ EXPOSE 80
25
+
26
+ # 启动 Nginx 和 Open WebUI
27
+ ENTRYPOINT ["sh", "-c", "nginx & /start.sh"]