From 4b77732929ab3b1fec1210d653b16c7407382c6c Mon Sep 17 00:00:00 2001 From: tcsenpai Date: Fri, 2 May 2025 10:46:59 +0200 Subject: [PATCH] correct backend port ingestion --- api.py | 7 ++++++- docker-compose.yml | 2 +- start_services.sh | 6 ++++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/api.py b/api.py index ce80df9..3e3de57 100755 --- a/api.py +++ b/api.py @@ -237,4 +237,9 @@ async def process_query(request: QueryRequest): interaction.save_session() if __name__ == "__main__": - uvicorn.run(api, host="0.0.0.0", port=os.getenv("BACKEND_PORT") or 8000) + envport = os.getenv("BACKEND_PORT") + if envport: + port = int(envport) + else: + port = 8000 + uvicorn.run(api, host="0.0.0.0", port=port) diff --git a/docker-compose.yml b/docker-compose.yml index 2c89610..94ee4a3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -62,7 +62,7 @@ services: environment: - NODE_ENV=development - CHOKIDAR_USEPOLLING=true - - BACKEND_URL=${BACKEND_URL:-http://backend:8000} + - BACKEND_URL=http://backend:${BACKEND_PORT:-8000} networks: - agentic-seek-net diff --git a/start_services.sh b/start_services.sh index 995f6ff..a4629e7 100755 --- a/start_services.sh +++ b/start_services.sh @@ -1,5 +1,8 @@ #!/bin/bash +# Loading .env file +source .env + command_exists() { command -v "$1" &> /dev/null } @@ -71,4 +74,7 @@ if ! $COMPOSE_CMD up; then echo "Possible fixes: Run with sudo or ensure port 8080 is free." exit 1 fi + +echo "Backend is expected to be running on port ${BACKEND_PORT:-8000}" + sleep 10 \ No newline at end of file