gaialive commited on
Commit
bec5e65
·
verified ·
1 Parent(s): c719f43

Upload startup.sh

Browse files
Files changed (1) hide show
  1. startup.sh +2 -14
startup.sh CHANGED
@@ -1,23 +1,11 @@
1
  #!/bin/sh
2
 
3
- # Create log directory if it doesn't exist
4
- mkdir -p /var/log
5
-
6
  # Start the Node.js server in the background
7
- node index.js > /var/log/node-server.log 2>&1 &
8
  NODE_PID=$!
9
 
10
  # Give the server a moment to start
11
- sleep 5
12
-
13
- # Check if the server is running
14
- if ! kill -0 $NODE_PID 2>/dev/null; then
15
- echo "Node.js server failed to start. Check logs in /var/log/node-server.log"
16
- exit 1
17
- fi
18
-
19
- echo "Node.js server started with PID $NODE_PID"
20
 
21
  # Start nginx in the foreground
22
- echo "Starting nginx..."
23
  nginx -g "daemon off;"
 
1
  #!/bin/sh
2
 
 
 
 
3
  # Start the Node.js server in the background
4
+ node index.js &
5
  NODE_PID=$!
6
 
7
  # Give the server a moment to start
8
+ sleep 3
 
 
 
 
 
 
 
 
9
 
10
  # Start nginx in the foreground
 
11
  nginx -g "daemon off;"