run.sh 559 B

1234567891011121314151617181920212223242526
  1. #!/usr/bin/env bash
  2. set -euo pipefail
  3. PORT="${PORT:-8550}"
  4. # Ensure we're running from the project root.
  5. ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
  6. cd "$ROOT_DIR"
  7. echo "Starting atlas2-mcp on port ${PORT}..."
  8. mkdir -p logs
  9. LOG_FILE="logs/server.log"
  10. PID_FILE="logs/server.pid"
  11. # Detach (background) and persist PID + logs.
  12. nohup uvicorn app.main:app \
  13. --host 0.0.0.0 \
  14. --port "${PORT}" \
  15. --env-file .env \
  16. >"${LOG_FILE}" 2>&1 &
  17. echo $! >"${PID_FILE}"
  18. echo "atlas2-mcp started (pid $(cat "${PID_FILE}")), logging to ${LOG_FILE}."