#!/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 </dev/null | cut -f1 || echo '0B')" echo " • Environment: $APP_ENV" echo " • Debug: ${DEBUG:-true}" echo "" # Executar comando echo "🚀 Starting API..." echo "" exec "$@"