From a63507c21ee1498ee48edb5028951a044cae69d2 Mon Sep 17 00:00:00 2001 From: Anuraag Jain Date: Thu, 11 Jan 2024 21:54:14 +0200 Subject: [PATCH 1/2] feat: custom port for server --- backend/dev.sh | 3 ++- backend/start.sh | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/backend/dev.sh b/backend/dev.sh index 9d0b5fa42..50dc5cad1 100644 --- a/backend/dev.sh +++ b/backend/dev.sh @@ -1 +1,2 @@ -uvicorn main:app --port 8080 --host 0.0.0.0 --forwarded-allow-ips '*' --reload \ No newline at end of file +SERVER_PORT="${SERVER_PORT:-8080}" +uvicorn main:app --port $SERVER_PORT --host 0.0.0.0 --forwarded-allow-ips '*' --reload \ No newline at end of file diff --git a/backend/start.sh b/backend/start.sh index ba68207ec..9ced76448 100755 --- a/backend/start.sh +++ b/backend/start.sh @@ -1,3 +1,4 @@ #!/usr/bin/env bash -uvicorn main:app --host 0.0.0.0 --port 8080 --forwarded-allow-ips '*' +SERVER_PORT="${SERVER_PORT:-8080}" +uvicorn main:app --host 0.0.0.0 --port $SERVER_PORT --forwarded-allow-ips '*' From 0e039492c6556081bca769d0777969f4a8eb0e63 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Fri, 12 Jan 2024 19:38:30 -0800 Subject: [PATCH 2/2] refac: SERVER_PORT renamed to PORT --- Dockerfile | 1 + backend/dev.sh | 4 ++-- backend/start.sh | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 64a307534..9e88bb90b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,6 +17,7 @@ RUN npm run build FROM python:3.11-slim-bookworm as base ENV ENV=prod +ENV PORT "" ENV OLLAMA_API_BASE_URL "/ollama/api" diff --git a/backend/dev.sh b/backend/dev.sh index 50dc5cad1..c66ae4ba9 100644 --- a/backend/dev.sh +++ b/backend/dev.sh @@ -1,2 +1,2 @@ -SERVER_PORT="${SERVER_PORT:-8080}" -uvicorn main:app --port $SERVER_PORT --host 0.0.0.0 --forwarded-allow-ips '*' --reload \ No newline at end of file +PORT="${PORT:-8080}" +uvicorn main:app --port $PORT --host 0.0.0.0 --forwarded-allow-ips '*' --reload \ No newline at end of file diff --git a/backend/start.sh b/backend/start.sh index 9ced76448..44e0c5810 100755 --- a/backend/start.sh +++ b/backend/start.sh @@ -1,4 +1,4 @@ #!/usr/bin/env bash -SERVER_PORT="${SERVER_PORT:-8080}" -uvicorn main:app --host 0.0.0.0 --port $SERVER_PORT --forwarded-allow-ips '*' +PORT="${PORT:-8080}" +uvicorn main:app --host 0.0.0.0 --port $PORT --forwarded-allow-ips '*'