File size: 519 Bytes
4bddfae
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fa2d678
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/bash

# Start the cog server in the background - Ensure correct path to cog
cd /src && python3 -m cog.server.http --threads=10 &

# Continuous loop for reliably checking cog server's readiness
while true; do
  if nc -z localhost 5000; then
    echo "Cog server is ready."
    break  # Exit the loop when the server is up
  fi
  echo "Waiting for cog server to start on port 5000..."
  sleep 5
done

# Run the application - only when cog server is ready
cd $HOME/app && . $HOME/.venv/bin/activate && python app.py