Reputation: 343
I have an app that I start with "npm start" I would like to run it in background. This app is hosted on aws EC2.
I tried :
npm start & Doesnt work if I disconnect ssh connection
nohup npm start & Same, it fail if I disconnect ssh connection
I tried to launch with root, or user, doesnt make any difference.
I also tried forever but I didnt manage to launch with npm start like "forever start npm start" doesnt work
Thanks a lot for your help
Upvotes: 1
Views: 1621
Reputation: 1
You can add a new command (nohup) to your package.json:
"scripts": {
"start": "vue-cli-service serve",
"nohup": "nohup vue-cli-service serve &"
},
It should copy your start command, but surround it with nohup and &
Upvotes: 0
Reputation: 343
I will try the docker style next time because im running out of time. I found a way using :
"screen" command !
Upvotes: 1
Reputation: 669
You have to use docker. You will need to read a lot the documentation, because it's complicated to understand if you dont know it : https://docs.docker.com/get-started/
But it does exactly what you want, running app in background in a container. You can close everything your app will still run.
Enjoy reading !
Upvotes: 1