diff --git a/docker/launch_backend_service.sh b/docker/launch_backend_service.sh index 56f2d570..c2adb7e7 100644 --- a/docker/launch_backend_service.sh +++ b/docker/launch_backend_service.sh @@ -3,6 +3,27 @@ # Exit immediately if a command exits with a non-zero status set -e +# Function to load environment variables from .env file +load_env_file() { + # Get the directory of the current script + local script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + local env_file="$script_dir/.env" + + # Check if .env file exists + if [ -f "$env_file" ]; then + echo "Loading environment variables from: $env_file" + # Source the .env file + set -a + source "$env_file" + set +a + else + echo "Warning: .env file not found at: $env_file" + fi +} + +# Load environment variables +load_env_file + # Unset HTTP proxies that might be set by Docker daemon export http_proxy=""; export https_proxy=""; export no_proxy=""; export HTTP_PROXY=""; export HTTPS_PROXY=""; export NO_PROXY="" export PYTHONPATH=$(pwd)