start.sh 638 B

123456789101112131415161718192021222324
  1. #!/bin/bash
  2. # CRM Python Backend Start Script
  3. SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
  4. cd "$SCRIPT_DIR"
  5. # Create venv if not exists
  6. if [ ! -d ".venv" ]; then
  7. echo "Creating virtual environment..."
  8. python3 -m venv .venv
  9. fi
  10. source .venv/bin/activate
  11. # Install dependencies
  12. echo "Installing dependencies..."
  13. pip install -r requirements.txt -q
  14. # Start server
  15. echo "Starting CRM Backend on port $(grep APP_PORT .env | cut -d= -f2 || echo 8080)..."
  16. python -m uvicorn app.main:app \
  17. --host "$(grep APP_HOST .env | cut -d= -f2 || echo '0.0.0.0')" \
  18. --port "$(grep APP_PORT .env | cut -d= -f2 || echo 8080)" \
  19. --reload