-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4014dab
commit 113e1f6
Showing
1 changed file
with
11 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,20 @@ | ||
#!/bin/bash | ||
# Purpose: Run streamlit application, ensuring that the `src` sub-modules are in the path | ||
# (This emulates PyCharm's run configuration button parameter: `add content roots to PYTHONPATH`) | ||
# Purpose: Run local development environment including API server, PostgreSQL container, and Streamlit application | ||
|
||
# Find the absolute path to the project root | ||
PROJECT_ROOT=$(realpath "$(dirname "$0")/..") | ||
|
||
# Set up the API server | ||
uvicorn src.fastAPI_app.app:app --reload & | ||
|
||
# Start a local PostgreSQL container | ||
docker compose up -d | ||
|
||
# Wait for a moment to ensure that the API server and PostgreSQL container are up | ||
sleep 5 | ||
|
||
# Set PYTHONPATH to the project root, ensuring it's not added multiple times | ||
export PYTHONPATH=$(echo $PYTHONPATH | tr ":" "\n" | grep -v "$PROJECT_ROOT" | tr "\n" ":")$PROJECT_ROOT | ||
|
||
# Run the Streamlit application | ||
venv/bin/streamlit run src/streamlit_app/app.py |