forked from impacte-ai/transcrevezap
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstart.sh
29 lines (23 loc) · 1 KB
/
start.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
# Função para inicializar configurações no Redis se não existirem
initialize_redis_config() {
redis-cli -h $REDIS_HOST -p $REDIS_PORT SET GROQ_API_KEY "sua_api_key_aqui" NX
redis-cli -h $REDIS_HOST -p $REDIS_PORT SET BUSINESS_MESSAGE "*Impacte AI* Premium Services" NX
redis-cli -h $REDIS_HOST -p $REDIS_PORT SET PROCESS_GROUP_MESSAGES "false" NX
redis-cli -h $REDIS_HOST -p $REDIS_PORT SET PROCESS_SELF_MESSAGES "true" NX
redis-cli -h $REDIS_HOST -p $REDIS_PORT SET API_DOMAIN "$API_DOMAIN" NX
}
# Aguardar o Redis estar pronto
echo "Aguardando o Redis ficar disponível..."
until redis-cli -h $REDIS_HOST -p $REDIS_PORT PING; do
echo "Redis não está pronto - aguardando..."
sleep 5
done
# Inicializar configurações no Redis (apenas se não existirem)
initialize_redis_config
# Iniciar o FastAPI em background
uvicorn main:app --host 0.0.0.0 --port 8005 &
# Iniciar o Streamlit
streamlit run manager.py --server.address 0.0.0.0 --server.port 8501
# Manter o script rodando
wait