Spaces:
Runtime error
Runtime error
Update start.sh
Browse files
start.sh
CHANGED
|
@@ -9,17 +9,10 @@ echo "User: $(whoami)"
|
|
| 9 |
mkdir -p /data/ai-toolkit
|
| 10 |
|
| 11 |
# Sync all files including frontend (but preserve node_modules and database)
|
| 12 |
-
echo "Syncing
|
| 13 |
rsync -a --exclude='database' --exclude='aitk_db.db' --exclude='datasets' \
|
| 14 |
/app/ai-toolkit/ /data/ai-toolkit/
|
| 15 |
-
echo "✓
|
| 16 |
-
|
| 17 |
-
# Rebuild frontend if UI files were updated
|
| 18 |
-
echo "Building frontend..."
|
| 19 |
-
cd /data/ai-toolkit/ui
|
| 20 |
-
npm run build
|
| 21 |
-
cd -
|
| 22 |
-
echo "✓ Frontend built"
|
| 23 |
|
| 24 |
# Ensure persistent directories exist
|
| 25 |
echo "Creating persistent directories..."
|
|
@@ -48,6 +41,11 @@ echo "Changing to writable UI directory..."
|
|
| 48 |
cd /data/ai-toolkit/ui
|
| 49 |
echo "Current directory: $(pwd)"
|
| 50 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
# Run database migrations/setup if needed
|
| 52 |
echo "=== Setting up database ==="
|
| 53 |
|
|
@@ -61,6 +59,11 @@ echo "Creating database tables..."
|
|
| 61 |
npx prisma db push --schema prisma/schema.prisma --skip-generate
|
| 62 |
echo "✓ Database tables created"
|
| 63 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
# Start the application with HuggingFace cache environment variables
|
| 65 |
echo ""
|
| 66 |
echo "=== Starting application ==="
|
|
|
|
| 9 |
mkdir -p /data/ai-toolkit
|
| 10 |
|
| 11 |
# Sync all files including frontend (but preserve node_modules and database)
|
| 12 |
+
echo "Syncing codebase..."
|
| 13 |
rsync -a --exclude='database' --exclude='aitk_db.db' --exclude='datasets' \
|
| 14 |
/app/ai-toolkit/ /data/ai-toolkit/
|
| 15 |
+
echo "✓ Codebase synced"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
|
| 17 |
# Ensure persistent directories exist
|
| 18 |
echo "Creating persistent directories..."
|
|
|
|
| 41 |
cd /data/ai-toolkit/ui
|
| 42 |
echo "Current directory: $(pwd)"
|
| 43 |
|
| 44 |
+
# Run database migrations/setup if needed
|
| 45 |
+
echo "=== Updating dependencies ==="
|
| 46 |
+
npm install
|
| 47 |
+
echo "✓ Dependencies updated"
|
| 48 |
+
|
| 49 |
# Run database migrations/setup if needed
|
| 50 |
echo "=== Setting up database ==="
|
| 51 |
|
|
|
|
| 59 |
npx prisma db push --schema prisma/schema.prisma --skip-generate
|
| 60 |
echo "✓ Database tables created"
|
| 61 |
|
| 62 |
+
# Build the app
|
| 63 |
+
echo "=== Building app ==="
|
| 64 |
+
npm run build
|
| 65 |
+
echo "✓ App built"
|
| 66 |
+
|
| 67 |
# Start the application with HuggingFace cache environment variables
|
| 68 |
echo ""
|
| 69 |
echo "=== Starting application ==="
|