Allow changing the port with --port flag #210
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I wanted to run openui on my home lab but I'm using the default port for another service, so I added the ability to configure the port with the
--portflag. It defaults to 7878. Here an example of using it. Also allows you to set the port using the environment variablePORT.$ docker run --rm --name openui -p 8989:8989 -e OPENAI_API_KEY -e ANTHROPIC_API_KEY -e OLLAMA_HOST=http://host.docker.internal:11434 openui --port 8989 __g@@@@@@gg__ _~@@ @@@@@@@@@@@@@@@ _@@@@@@@@@@@@@@@@g_ _@@@@@@@, @@@@@@@@@@@@@@@ o@@@@@@@@@@@@@@@@@@@@@ _g@@@@@@@@@@@L @@@@@@@@@@@@@@@ ,@@@@@@@@@@@@@@@@@@@B"~@@@@@@@@@@@@@@@@a%@@@@@@@@@@@@@@ ,""""""""""""""""""_g@@@@@@@@@@@@@@@@@@@@g\@@@@@@@@@@@@@ @@@@@@@@@@@@@@P"~?????????????????????????? gggggggggggg !@@@@@@@@@@@@@@,=============================|@@@@@@@@@@@ [@@@@@@@@@@@@@@@L"""""""""""""""""""""""""""" @@@@@@@@@@@ BBBBBBBBBBBBBBBBh<========================== @@@@@@@@@@@ vggggggggggggggggg ggggggggggggggggggggggggg,@@@@@@@@@@@ %@@@@@@@@@@@@@@@@@'@@@@@@@@@@@@@@@@@@@@@@@'@@@@@@@@@@@@ "@@@@@@@@@@@@@@@@@LQ@@@@@@@@@@@@@@@@@@@@,@@@@@@@@@@@@@ "@@@@@@@@@@@@@@@@@'@@@@@@@@@@@@@@@@@Po@@@@@@@@@@@@@@ "4@@@@@@@@@@@P" """"""""""""" @@@@@@@@@@@@@@@ INFO (openui): Starting OpenUI AI Server created by W&B... INFO (openui): Starting LiteLLM in the background with config: /tmp/tmp7a2jx8b0.yaml INFO (openui): Running API Server INFO (uvicorn.error): Started server process [1] INFO (uvicorn.error): Waiting for application startup. DEBUG (openui): Starting up server in 1... INFO (uvicorn.error): Application startup complete. INFO (uvicorn.error): Uvicorn running on http://0.0.0.0:8989 (Press CTRL+C to quit)Enhancements to port configuration:
backend/openui/__main__.py: Added logic to parse the port number from the command-line argument--portif provided, or fallback to thePORTenvironment variable, defaulting to 7878 if neither is specified.backend/openui/__main__.py: Updated theuvicorn.runcalls to use the dynamically determined port instead of the hardcoded value 7878. [1] [2]