Skip to content

Instantly share code, notes, and snippets.

@anataliocs
Last active December 3, 2025 14:32
Show Gist options
  • Select an option

  • Save anataliocs/bca289ba9738696d518df1d6e4f27b8d to your computer and use it in GitHub Desktop.

Select an option

Save anataliocs/bca289ba9738696d518df1d6e4f27b8d to your computer and use it in GitHub Desktop.
Start docusaurus and export logs to file
#!/bin/bash
set -e
touch docs.log
chmod 775 docs.log
nohup yarn start --port 3000 > docs.log 2>&1 & echo $! > run.pid
echo "Docusaurus running on process: $(cat run.pid)"
echo "Docusaurus running on port 3000"
echo ""
echo "View logs: tail -f docs.log"
echo "Stop docusaurus: kill -9 '$(lsof -t -i:3000)'"
@anataliocs
Copy link
Author

Logs are exported to docs.log
Process ID is exported to run.pid

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment