-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstart.sh
More file actions
executable file
·45 lines (37 loc) · 1.11 KB
/
start.sh
File metadata and controls
executable file
·45 lines (37 loc) · 1.11 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/sh
set -e
echo "🚀 Starting SimpleCheckList Full Stack Application"
echo "📍 Working directory: $(pwd)"
# Initialize database if it doesn't exist
if [ ! -f /app/data/checklist.db ]; then
echo "📊 Initializing database..."
mkdir -p /app/data
cd /app/server
node scripts/init-db.js
fi
# Start nginx in background
echo "🌐 Starting Nginx (Frontend server on port 80)..."
nginx
# Start backend server
echo "🔧 Starting Backend API server (port 8355)..."
cd /app/server
node index.js &
BACKEND_PID=$!
# Wait for backend to start
echo "⏳ Waiting for backend to be ready..."
sleep 5
# Test if backend is running
if curl -f http://localhost:8355/api/health > /dev/null 2>&1; then
echo "✅ Backend API is ready!"
else
echo "❌ Backend API failed to start"
exit 1
fi
echo ""
echo "🎉 SimpleCheckList Full Stack Application is ready!"
echo "🌐 Frontend (Web UI): http://localhost:8080"
echo "📡 Backend API: http://localhost:8355/api"
echo "🏥 Health check: http://localhost:8355/api/health"
echo ""
# Keep container running by waiting for background processes
wait $BACKEND_PID