web / Dockerfile
nbugs's picture
Update Dockerfile
006016c verified
raw
history blame contribute delete
874 Bytes
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