49 lines
1.3 KiB
Bash
Executable File
49 lines
1.3 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# ====================================
|
|
# TubeScript API - Iniciar solo Streamlit
|
|
# ====================================
|
|
|
|
echo "🚀 Iniciando servicio Streamlit..."
|
|
echo ""
|
|
|
|
# Detener contenedor si está corriendo
|
|
docker stop streamlit_panel 2>/dev/null || true
|
|
docker rm streamlit_panel 2>/dev/null || true
|
|
|
|
# Construir imagen
|
|
echo "📦 Construyendo imagen..."
|
|
docker build -t tubescript-api .
|
|
|
|
# Leer API_URL desde .env o usar valor por defecto
|
|
if [ -f .env ]; then
|
|
export $(cat .env | grep -v '^#' | xargs)
|
|
fi
|
|
|
|
API_URL=${API_URL:-http://tubescript-api:8000}
|
|
|
|
echo "🔗 Conectando a API: $API_URL"
|
|
|
|
# Iniciar contenedor
|
|
echo "▶️ Iniciando contenedor Streamlit..."
|
|
docker run -d \
|
|
--name streamlit_panel \
|
|
--network tubescript-network \
|
|
-p 8501:8501 \
|
|
-v "$(pwd)/data:/app/data:ro" \
|
|
-e API_COOKIES_PATH=/app/data/cookies.txt \
|
|
-e PYTHONUNBUFFERED=1 \
|
|
-e API_URL="$API_URL" \
|
|
tubescript-api \
|
|
streamlit run streamlit_app.py --server.port=8501 --server.address=0.0.0.0 --server.headless=true --browser.gatherUsageStats=false
|
|
|
|
echo ""
|
|
echo "✅ Streamlit iniciado correctamente"
|
|
echo "📍 URL: http://localhost:8501"
|
|
echo ""
|
|
echo "📋 Ver logs:"
|
|
echo " docker logs -f streamlit_panel"
|
|
echo ""
|
|
echo "🛑 Detener:"
|
|
echo " docker stop streamlit_panel"
|