mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-07 03:18:23 -05:00
[GH-ISSUE #20444] Docker hot-reload development setup #57854
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @vlthr on GitHub (Jan 7, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/20444
Summary
Create a Docker-based development workflow with hot-reload for both frontend (Vite/Svelte) and backend (uvicorn/Python), eliminating the need to rebuild the image on every code change.
Goals
Files Created
Dockerfile.dev- Development image with Node.js 22 + Python 3.11docker-compose.dev.yaml- Dev compose with volume mountsscripts/dev-entrypoint.sh- Entrypoint running both serversUsage
Access via
https://open-webui.open-webui.orb.localorhttp://localhost:5173@vlthr commented on GitHub (Jan 7, 2026):
Progress Notes
Research Phase
npm run dev+backend/dev.sh)src/lib/constants.tsauto-detects dev mode and points to port 8080Process Management
sh -c "cmd1 & cmd2"has problems (no signal propagation, no crash detection)--initflag (adds tini as PID 1) + bash wrapper withwait -nFile Watching on macOS Docker
WATCHFILES_FORCE_POLLING=trueandCHOKIDAR_USEPOLLING=trueVolume Strategy
.:/app:cachedfor simplicity- /app/node_modulespreserves container's Linux binariesopen-webui:/app/backend/datashares data with production compose@vlthr commented on GitHub (Jan 7, 2026):
HTTPS Access via OrbStack
Problem
Accessing via OrbStack's HTTPS URL (
https://open-webui.open-webui.orb.local) causes mixed content errors - the frontend tries to make HTTP requests to port 8080.Options Considered
http://localhost:5173but not HTTPS (mixed content)OrbStack Limitation
Researched whether OrbStack container labels could terminate HTTPS on multiple ports. Not supported.
dev.orbstack.http-portonly allows ONE port for HTTPS terminationdomain@portsyntax availableSolution: Vite Proxy (env var controlled)
Added optional proxy support to
vite.config.tsviaVITE_API_PROXY_TARGETenv var:/api,/ollama,/openai,/socket.ioto backendPUBLIC_API_BASE_URL=(empty) makes frontend use same-origin requestsVite Bug
__VITE_ADDITIONAL_SERVER_ALLOWED_HOSTSenv var doesn't work unlessallowedHostsarray already exists in config. Had to hardcode.open-webui.orb.localin vite.config.ts for now.@vlthr commented on GitHub (Jan 7, 2026):
Changes to Upstream Files
vite.config.tsVITE_API_PROXY_TARGETenv var support for API proxyingallowedHosts: ['.open-webui.orb.local']for OrbStack accesssrc/lib/constants.tsPUBLIC_API_BASE_URLenv var override for API base URLThese changes add flexibility without affecting default behavior and could be upstreamed.
Local-only Files
Dockerfile.devdocker-compose.dev.yamlscripts/dev-entrypoint.sh@vlthr commented on GitHub (Jan 7, 2026):
Development setup complete and working. Access via
https://open-webui.open-webui.orb.localorhttp://localhost:5173.@vlthr commented on GitHub (Jan 7, 2026):
Final Summary - Decisions & Fixes
Files Created
Dockerfile.dev- Node 22 + Python 3.11 dev imagedocker-compose.dev.yaml- Dev compose with volume mountsscripts/dev-entrypoint.sh- Runs both servers with proper signal handlingKey Fixes
Process Management
--initflag (tini) for signal propagationwait -nin bash for crash detectionStatic Files
config.pydeletes STATIC_DIR contents at import then copies fromFRONTEND_BUILD_DIR/staticFRONTEND_BUILD_DIR=/appso it copies from/app/staticHTTPS via OrbStack
/api,/ollama,/openai,/ws/socket.ioto backendPUBLIC_API_BASE_URL=(empty) makes frontend use same-originallowedHosts: ['.open-webui.orb.local']in vite.config.ts__VITE_ADDITIONAL_SERVER_ALLOWED_HOSTSenv var is buggy - doesn't work without existing arrayWebSocket
/ws/socket.iopath (not/socket.io)/ws/socket.ioLiveKit
LIVEKIT_URL=ws://livekit:7880- internal Docker URL for backendLIVEKIT_PUBLIC_URL=wss://livekit.open-webui.orb.local- browser uses OrbStack HTTPSCold Start Optimization
BYPASS_EMBEDDING_AND_RETRIEVAL=true- skip SentenceTransformer loadingENABLE_BASE_MODELS_CACHE=false- skip model pre-cachingOrbStack vs Docker Desktop
WATCHFILES_FORCE_POLLING=true+CHOKIDAR_USEPOLLING=trueVolume Strategy
.:/app:cachedfor hot reload/app/node_modulespreserves Linux binariesopen-webui:/app/backend/datashares with production@vlthr commented on GitHub (Jan 7, 2026):
Updated with final summary of all decisions and fixes.