|
FROM ghcr.io/open-webui/open-webui:main |
|
|
|
RUN apt-get update && apt-get install -y python3 python3-pip |
|
RUN pip3 install --no-cache-dir huggingface_hub |
|
|
|
COPY sync_data.sh sync_data.sh |
|
# 复制自定义CSS和JS文件 |
|
#COPY custom.css /app/build/assets/ |
|
#COPY custom.js /app/build/assets/ |
|
COPY editor.css /app/build/assets/ |
|
COPY editor.js /app/build/assets/ |
|
|
|
# 在</head>标签前添加custom.css引用 |
|
RUN sed -i 's|</head>|<link rel="stylesheet" href="assets/custom.css"></head>|' /app/build/index.html && \ |
|
sed -i 's|</body>|<script src="assets/custom.js"></script></body>|' /app/build/index.html && \ |
|
sed -i 's|</head>|<link rel="stylesheet" href="assets/editor.css"></head>|' /app/build/index.html && \ |
|
sed -i 's|</body>|<script src="assets/editor.js"></script></body>|' /app/build/index.html |
|
RUN 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 |