mirror of
https://github.com/Canner/WrenAI.git
synced 2026-10-24 23:57:16 +08:00
chore(wren-ai-service): fix entrypoint (#568)
* fix entrypoint * add timeout * fix * update * fix
This commit is contained in:
@@ -41,6 +41,7 @@ services:
|
||||
- ${AI_SERVICE_FORWARD_PORT}:${WREN_AI_SERVICE_PORT}
|
||||
environment:
|
||||
WREN_AI_SERVICE_PORT: ${WREN_AI_SERVICE_PORT}
|
||||
WREN_UI_PORT: ${WREN_UI_PORT}
|
||||
WREN_UI_ENDPOINT: ${WREN_UI_ENDPOINT}
|
||||
LLM_OPENAI_API_KEY: ${LLM_OPENAI_API_KEY}
|
||||
EMBEDDER_OPENAI_API_KEY: ${EMBEDDER_OPENAI_API_KEY}
|
||||
|
||||
@@ -53,6 +53,7 @@ services:
|
||||
- ${AI_SERVICE_FORWARD_PORT}:${WREN_AI_SERVICE_PORT}
|
||||
environment:
|
||||
WREN_AI_SERVICE_PORT: ${WREN_AI_SERVICE_PORT}
|
||||
WREN_UI_PORT: ${WREN_UI_PORT}
|
||||
WREN_UI_ENDPOINT: http://wren-ui:${WREN_UI_PORT}
|
||||
LLM_OPENAI_API_KEY: ${LLM_OPENAI_API_KEY}
|
||||
EMBEDDER_OPENAI_API_KEY: ${EMBEDDER_OPENAI_API_KEY}
|
||||
|
||||
@@ -4,6 +4,12 @@ set -e
|
||||
# Start wren-ai-service in the background
|
||||
uvicorn src.__main__:app --host 0.0.0.0 --port $WREN_AI_SERVICE_PORT --loop uvloop --http httptools &
|
||||
|
||||
# Wait for wren-ui to be responsive
|
||||
echo "Waiting for wren-ui to start..."
|
||||
while ! nc -z -w 5 wren-ui $WREN_UI_PORT && ! nc -z -w 5 host.docker.internal $WREN_UI_PORT; do
|
||||
sleep 1 # wait for 1 second before check again
|
||||
done
|
||||
|
||||
# Wait for the server to be responsive
|
||||
echo "Waiting for wren-ai-service to start..."
|
||||
while ! nc -z localhost $WREN_AI_SERVICE_PORT; do
|
||||
|
||||
Reference in New Issue
Block a user