From cae4725e897977d7f8b67769f6439ff344056bfa Mon Sep 17 00:00:00 2001 From: Andrew Canis Date: Wed, 8 May 2024 05:27:18 -0400 Subject: [PATCH] Frontend: Fix #97, change default python interpreter URL to http://terrarium:8080 (#103) Fix #97: Change default python interpreter URL to http://terrarium:8080 The previous default http://localhost:8080 didn't work with docker compose on Mac Co-authored-by: Tianjing Li --- .env-template | 2 +- Dockerfile | 2 +- README.md | 2 ++ docker_scripts/env-defaults | 2 +- src/backend/cli/main.py | 2 +- 5 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.env-template b/.env-template index 232942ee84..bc22151ee3 100644 --- a/.env-template +++ b/.env-template @@ -3,7 +3,7 @@ NEXT_PUBLIC_API_HOSTNAME=http://backend:8000 DATABASE_URL=postgresql+psycopg2://postgres:postgres@db:5432 # TOOLS -PYTHON_INTERPRETER_URL=http://localhost:8080 +PYTHON_INTERPRETER_URL=http://terrarium:8080 TAVILY_API_KEY= WOLFRAM_ALPHA_APP_ID= diff --git a/Dockerfile b/Dockerfile index b1dcf96fa7..f4496e4a6a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -56,7 +56,7 @@ RUN npm install -g pm2 # ENV for frontend ENV NEXT_PUBLIC_API_HOSTNAME="http://localhost:8000" -ENV PYTHON_INTERPRETER_URL="http://localhost:8080" +ENV PYTHON_INTERPRETER_URL="http://terrarium:8080" # Install frontend dependencies WORKDIR /workspace/src/interfaces/coral_web diff --git a/README.md b/README.md index 8fa0cb8564..851887f838 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,9 @@ Try the default Toolkit application yourself by deploying it in a container loca docker run -e COHERE_API_KEY='>>YOUR_API_KEY<<' -p 8000:8000 -p 4000:4000 ghcr.io/cohere-ai/cohere-toolkit:latest ``` + or cloning and running locally: + ```bash git clone https://github.com/cohere-ai/cohere-toolkit.git make first-run diff --git a/docker_scripts/env-defaults b/docker_scripts/env-defaults index b6260b749c..3bcfad9bba 100644 --- a/docker_scripts/env-defaults +++ b/docker_scripts/env-defaults @@ -14,5 +14,5 @@ DB_EXTENSION=${DB_EXTENSION:-} # Defaults for the toolkit export NEXT_PUBLIC_API_HOSTNAME=${NEXT_PUBLIC_API_HOSTNAME:-http://localhost:8000} -export PYTHON_INTERPRETER_URL=${PYTHON_INTERPRETER_URL:-http://localhost:8080} +export PYTHON_INTERPRETER_URL=${PYTHON_INTERPRETER_URL:-http://terrarium:8080} export DATABASE_URL=${DATABASE_URL:-postgresql+psycopg2://postgre:postgre@localhost:5432/toolkit} \ No newline at end of file diff --git a/src/backend/cli/main.py b/src/backend/cli/main.py index 3f51f98521..622d074de0 100755 --- a/src/backend/cli/main.py +++ b/src/backend/cli/main.py @@ -41,7 +41,7 @@ class ToolName(StrEnum): ╚════╝ ╚════╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚════╝ ╚════╝ ╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝ """ DATABASE_URL_DEFAULT = "postgresql+psycopg2://postgres:postgres@db:5432" -PYTHON_INTERPRETER_URL_DEFAULT = "http://localhost:8080" +PYTHON_INTERPRETER_URL_DEFAULT = "http://terrarium:8080" NEXT_PUBLIC_API_HOSTNAME_DEFAULT = "http://backend:8000" DOT_ENV_FILE_PATH = ".env"