ai-voicebot/voicebot/entrypoint.sh
2025-09-02 14:47:31 -07:00

39 lines
1.3 KiB
Bash

#!/bin/bash
set -e
# Create the virtual environment if it doesn't exist
if [ ! -d "/voicebot/.venv/bin" ]; then
echo "Creating virtual environment..."
if [ -e /voicebot/pyproject.toml ]; then
rm -r /voicebot/pyproject.toml
fi
uv init \
--python /usr/bin/python3.12 \
--name "ai-voicebot-agent" \
--description "AI Voicebot Environment" \
.
uv add -r ./requirements.txt
fi
export VIRTUAL_ENV=/voicebot/.venv
export PATH="$VIRTUAL_ENV/bin:$PATH"
# Launch voicebot in production or development mode
if [ "$PRODUCTION" != "true" ]; then
echo "Starting voicebot in development mode with auto-reload..."
# Fix: Use single --watch argument with multiple paths instead of multiple --watch arguments
python3 -u scripts/reload_runner.py --delay-restart 3 --watch . /shared --verbose --interval 0.5 -- uv run main.py \
--insecure \
--server-url https://ketrenos.com/ai-voicebot \
--lobby default \
--session-name "Python Voicebot" \
--password "v01c3b0t"
else
echo "Starting voicebot in production mode..."
exec uv run main.py \
--server-url https://ai-voicebot.ketrenos.com \
--lobby default \
--session-name "Python Voicebot" \
--password "v01c3b0t"
fi