Pommsn commited on
Commit
7bfcdc2
ยท
verified ยท
1 Parent(s): d4ea64f

Update start.sh

Browse files
Files changed (1) hide show
  1. start.sh +21 -10
start.sh CHANGED
@@ -1,15 +1,26 @@
1
  #!/bin/bash
2
- # Dify Startup for HF Spaces
3
 
4
- echo "๐Ÿš€ Starting Dify..."
5
-
6
- # Must be in /app/api directory to import 'app'
7
  cd /app/api
8
 
9
- # 1. Database Migration (correct command)
10
- echo "๐Ÿ—„๏ธ Running migrations..."
11
- flask db upgrade 2>/dev/null || echo "โš ๏ธ Migration skipped"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
 
13
- # 2. Start API on port 7860
14
- echo "๐Ÿง  Starting API on port 7860..."
15
- exec gunicorn --bind 0.0.0.0:7860 --workers 1 --timeout 360 app:app
 
1
  #!/bin/bash
2
+ echo "๐Ÿš€ Starting Dify All-in-One..."
3
 
 
 
 
4
  cd /app/api
5
 
6
+ # 1. Database Migration
7
+ echo "๐Ÿ—„๏ธ Database migration..."
8
+ flask db upgrade 2>/dev/null || echo "Done"
9
+
10
+ # 2. Start API (port 5001)
11
+ echo "๐Ÿง  Starting API..."
12
+ gunicorn --bind 127.0.0.1:5001 --workers 1 --timeout 360 app:app &
13
+
14
+ # 3. Start Nginx (port 7860)
15
+ echo "๐Ÿšฆ Starting Nginx..."
16
+ nginx &
17
+
18
+ # 4. Start Web (port 3000)
19
+ echo "๐ŸŒ Starting Web..."
20
+ cd /app/web
21
+ export PORT=3000
22
+ export HOSTNAME=0.0.0.0
23
+ node server.js &
24
 
25
+ echo "โœ… All services started!"
26
+ wait