Skip to content

Instantly share code, notes, and snippets.

@UbuntuEvangelist
Forked from WebSofter/ecosystem.config.json
Created October 2, 2023 19:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save UbuntuEvangelist/1370c67b101874ba57aff87384ab39ad to your computer and use it in GitHub Desktop.
Save UbuntuEvangelist/1370c67b101874ba57aff87384ab39ad to your computer and use it in GitHub Desktop.
Run laravel artisian serve script via pm2
{
"apps": [{
"name": "laravel-app",
"script": "artisan",
"args": ["serve", "--host=0.0.0.0", "--port=3333"],
"instances": "1",
"wait_ready": true,
"autorestart": false,
"max_restarts": 1,
"interpreter" : "php",
"watch": true,
"error_file": "log/err.log",
"out_file": "log/out.log",
"log_file": "log/combined.log",
"time": true
}]
}
1. install Node and PM2 module
2. Add file ecosystem.config.json to root folder of laravel project
2. Run command:
$ pm2 start ecosystem.config.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment