|
|
|
FROM ghcr.io/open-webui/open-webui:main |
|
|
|
|
|
WORKDIR /app |
|
|
|
|
|
|
|
RUN export DEBIAN_FRONTEND=noninteractive && \ |
|
apt-get update && \ |
|
apt-get install -y --no-install-recommends python3 python3-pip curl && \ |
|
pip3 install --no-cache-dir huggingface_hub && \ |
|
apt-get clean && \ |
|
rm -rf /var/lib/apt/lists/* |
|
|
|
|
|
COPY hf_sync.py /app/hf_sync.py |
|
|
|
|
|
COPY sync_data.sh /app/sync_data.sh |
|
|
|
|
|
COPY entrypoint.sh /app/entrypoint.sh |
|
|
|
|
|
|
|
COPY custom.css /app/build/assets/ |
|
COPY custom.js /app/build/assets/ |
|
COPY editor.css /app/build/assets/ |
|
COPY editor.js /app/build/assets/ |
|
|
|
|
|
|
|
|
|
RUN if [ -f /app/build/index.html ]; then \ |
|
sed -i \ |
|
-e 's|</head>|<link rel="stylesheet" href="assets/editor.css">\n</head>|' \ |
|
-e 's|</body>|<script src="assets/editor.js"></script>\n</body>|' \ |
|
-e 's|</head>|<link rel="stylesheet" href="assets/custom.css">\n</head>|' \ |
|
-e 's|</body>|<script src="assets/custom.js"></script>\n</body>|' \ |
|
/app/build/index.html; \ |
|
else \ |
|
echo "警告:未找到 /app/build/index.html,跳过注入CSS/JS。"; \ |
|
fi |
|
|
|
|
|
RUN chmod +x /app/sync_data.sh && \ |
|
chmod +x /app/hf_sync.py && \ |
|
chmod +x /app/entrypoint.sh |
|
|
|
|
|
ENTRYPOINT ["/app/entrypoint.sh"] |
|
|
|
|
|
|
|
|