aanycmn commited on
Commit
8964ea7
·
verified ·
1 Parent(s): 334aae9

Create start.sh

Browse files
Files changed (1) hide show
  1. start.sh +21 -0
start.sh ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+ set -e
3
+
4
+ # Iniciar Xvfb (display virtual para Chrome em modo "headed")
5
+ # Headless nativo e detectado pelo Cloudflare — Xvfb simula monitor real
6
+ Xvfb :99 -screen 0 1920x1080x24 -ac &
7
+ XVFB_PID=$!
8
+ sleep 1
9
+
10
+ # Verificar se Xvfb iniciou
11
+ if ! kill -0 $XVFB_PID 2>/dev/null; then
12
+ echo "ERRO: Xvfb nao iniciou"
13
+ exit 1
14
+ fi
15
+
16
+ echo "Xvfb iniciado em DISPLAY=:99 (PID=$XVFB_PID)"
17
+ echo "Iniciando servidor na porta 7860..."
18
+
19
+ # --workers 1: browser singleton, nao pode ter multiplos workers
20
+ # --timeout-keep-alive 300: conexoes longas para lotes grandes
21
+ exec uvicorn app:app --host 0.0.0.0 --port 7860 --workers 1 --timeout-keep-alive 300