larxius commited on
Commit
8e9e698
·
verified ·
1 Parent(s): a3c8f2c

Add start.sh with startup logging

Browse files
Files changed (1) hide show
  1. start.sh +20 -0
start.sh ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+ set -e
3
+
4
+ echo "=== SentinelScan Startup ==="
5
+ echo "[startup] Checking Python..."
6
+ python --version
7
+
8
+ echo "[startup] Testing app import..."
9
+ python -c "
10
+ import sys, os
11
+ sys.path.insert(0, os.path.abspath('backend_structured'))
12
+ from backend_structured import create_app
13
+ app = create_app()
14
+ print('[startup] App imported OK, routes:', len(list(app.url_map.iter_rules())))
15
+ " 2>&1
16
+
17
+ echo "[startup] Starting gunicorn..."
18
+ exec gunicorn --bind 0.0.0.0:7860 --workers 1 --timeout 300 \
19
+ --access-logfile - --error-logfile - \
20
+ app:app