Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files12345676 unmodified lines141516171819202122232425262728293031FROM ghcr.io/open-webui/open-webui:mainRUN chmod -R 777 /appCOPY icon.png /app/build/static/favicon.pngCOPY icon.png /app/build/static/favicon.icoCOPY icon.png /app/build/static/apple-touch-icon.png6 unmodified linesCOPY icon.png /app/build/static/web-app-manifest-512x512.pngCOPY custom.css /app/build/static/custom.cssRUN find /app/build -type f -exec sed -i 's/Open WebUI/WynGPT/g' {} + || true && \find /app/build -type f -exec sed -i 's/OpenWebUI/WynGPT/g' {} + || true && \find /app/build -type f -exec sed -i 's/open-webui/wyngpt/g' {} + || trueCOPY requirements.txt /app/requirements.txtCOPY sync_webuidb.sh /app/sync_webuidb.shRUN chmod +x /app/sync_webuidb.sh && pip install -r /app/requirements.txtENV HOST=0.0.0.0ENV PORT=7860EXPOSE 7860CMD bash -c "bash start.sh & bash /app/sync_webuidb.sh"1234567891011121314151617181920212223246 unmodified lines313233343536373839404142434445464748495051525354# --- Base: Python 3.11 cho backend + CLI open-webuiFROM python:3.11-slim AS app# Packages hệ thống (git để clone, node/npm để build frontend)RUN apt-get update && apt-get install -y --no-install-recommends \git nodejs npm bash ca-certificates && \rm -rf /var/lib/apt/lists/*WORKDIR /app# Lấy mã nguồn Open WebUIRUN git clone https://github.com/open-webui/open-webui.git .# Cài đặt Python deps & CLI (tạo lệnh `open-webui`)RUN pip install --no-cache-dir -U pip && \pip install --no-cache-dir -e .# Cài đặt & build frontendRUN npm ci || npm install && npm run build# Tuỳ biến icon/CSSCOPY icon.png /app/build/static/favicon.pngCOPY icon.png /app/build/static/favicon.icoCOPY icon.png /app/build/static/apple-touch-icon.png6 unmodified linesCOPY icon.png /app/build/static/web-app-manifest-512x512.pngCOPY custom.css /app/build/static/custom.css# Đổi text thương hiệu như cũRUN find /app/build -type f -exec sed -i 's/Open WebUI/WynGPT/g' {} + || true && \find /app/build -type f -exec sed -i 's/OpenWebUI/WynGPT/g' {} + || true && \find /app/build -type f -exec sed -i 's/open-webui/wyngpt/g' {} + || true# Phần phụ trợ của bạnCOPY requirements.txt /app/requirements-extra.txtRUN pip install --no-cache-dir -r /app/requirements-extra.txtCOPY sync_webuidb.sh /app/sync_webuidb.shRUN chmod +x /app/sync_webuidb.sh# Cấu hình mạngENV HOST=0.0.0.0ENV PORT=7860EXPOSE 7860# Quan trọng: dùng CLI open-webui, không dùng start.sh# PORT env sẽ bị bỏ qua khi chạy CLI, nên chỉ định --portCMD bash -c "open-webui serve --host ${HOST} --port ${PORT} & bash /app/sync_webuidb.sh"
Dockerfile+29-6