mirror of
https://github.com/open-webui/pipelines
synced 2025-05-12 00:20:48 +00:00
24 lines
796 B
Bash
Executable File
24 lines
796 B
Bash
Executable File
#!/usr/bin/env bash
|
|
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 '*'
|