File size: 874 Bytes
77ecd1e
c31f3f8
006016c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
FROM ghcr.io/open-webui/open-webui:main

# 合并安装命令并清理缓存
RUN apt-get update && apt-get install -y python3 python3-pip \
    && pip3 install --no-cache-dir huggingface_hub \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/*

# 复制文件
COPY sync_data.sh ./
COPY custom.css custom.js editor.css editor.js /app/build/assets/

# 优化 sed 命令,一次性处理 HTML 修改
RUN sed -i \
    -e '/<\/head>/i <link rel="stylesheet" href="assets/editor.css">' \
    -e '/<\/head>/i <link rel="stylesheet" href="assets/custom.css">' \
    -e '/<\/body>/i <script src="assets/editor.js"></script>' \
    -e '/<\/body>/i <script src="assets/custom.js"></script>' \
    /app/build/index.html \
    && chmod -R 777 ./data \
    && chmod -R 777 /app/backend/open_webui/static \
    && chmod +x sync_data.sh \
    && sed -i "1r sync_data.sh" ./start.sh