Update start.sh

This commit is contained in:
Timothy J. Baek 2024-05-30 11:55:27 -07:00
parent 604ea52883
commit f48f3ae276

View File

@ -2,4 +2,22 @@
PORT="${PORT:-9099}"
HOST="${HOST:-0.0.0.0}"
# Function to install requirements if requirements.txt is provided
install_requirements() {
if [[ -f "$1" ]]; then
echo "requirements.txt found at $1. Installing dependencies..."
pip install -r "$1"
else
echo "requirements.txt not found at $1. Skipping installation of dependencies."
fi
}
# Check if the PIPELINES_REQUIREMENTS_PATH environment variable is set and non-empty
if [[ -n "$PIPELINES_REQUIREMENTS_PATH" ]]; then
# Install dependencies from the specified requirements.txt
install_requirements "$PIPELINES_REQUIREMENTS_PATH"
else
echo "PIPELINES_REQUIREMENTS_PATH not specified. Skipping installation of dependencies."
fi
uvicorn main:app --host "$HOST" --port "$PORT" --forwarded-allow-ips '*'