PARA.AI / scripts /docker-entrypoint-lite.sh
Carlex22's picture
Revert "ParaAIV3.1"
1f24745
#!/bin/bash
set -e
echo "=========================================="
echo " para.AI v3.0 - SQLite Test Version"
echo "=========================================="
echo ""
# Verificar variáveis de ambiente obrigatórias
if [ -z "$GROQ_API_KEY" ]; then
echo "⚠️ WARNING: GROQ_API_KEY not set!"
echo " LLM features will be limited"
fi
# Criar diretórios se não existirem
mkdir -p /app/data /app/logs
mkdir -p /app/data/files /app/data/uploads /app/data/outputs /app/data/temp /app/data/backups
# Verificar se arquivo SQLite existe
if [ ! -f "/app/data/para_ai.db" ]; then
echo "📁 Creating SQLite database..."
touch /app/data/para_ai.db
chmod 666 /app/data/para_ai.db
# Executar migrations (se houver)
if [ -d "/app/alembic" ]; then
echo "🔄 Running Alembic migrations..."
alembic upgrade head || echo "⚠️ Migrations failed (continuing anyway)"
fi
fi
# Otimizar SQLite
#echo "⚙️ Configuring SQLite..."
#sqlite3 /app/data/para_ai.db <<EOF
#PRAGMA journal_mode=WAL;
#PRAGMA synchronous=NORMAL;
#PRAGMA cache_size=10000;
#PRAGMA foreign_keys=ON;
#PRAGMA auto_vacuum=FULL;
#.quit
#EOF
# Informações do sistema
echo ""
echo "📊 System Info:"
echo " • Python: $(python --version)"
echo " • Database: SQLite"
echo " • DB File: /app/data/para_ai.db"
echo " • DB Size: $(du -h /app/data/para_ai.db 2>/dev/null | cut -f1 || echo '0B')"
echo " • Environment: $APP_ENV"
echo " • Debug: ${DEBUG:-true}"
echo ""
# Executar comando
echo "🚀 Starting API..."
echo ""
exec "$@"