open-wa / wa-automate-docker

💬 🤖 The easiest way to turn your WhatsApp into an API. Be sure to 🌟 this repository for updates!
110 stars 32 forks source link

Run easy api on background #11

Closed hafriz closed 3 years ago

hafriz commented 3 years ago

Hi,

I have follow the instruction and the api working successfull. But how to ensure the npx is running although when i close the terminal?

smashah commented 3 years ago

Hi @hafriz thanks for trying out the easy API. You can detach the process depending on your operating system

I know on unix based systems you can ctrl+z and then the command bg which then sends the program to the background. In order to bring it back you can then use fg.

But maybe it would be useful to detach the process using a CLI flag. What do you think?

hafriz commented 3 years ago

Hi @smashah,

Yes, it is good if we can get it running on the background directly using cli flag. I'm not sure if the feature is there yet. I found the way to auto start / background process for npm using pm2 but seems cannot use with npx.

Is there is the way that i can set it up auto start when server is restarting? I know it can be work using docker. But there is problem to run docker in my environment as i'm hosting it in my raspberry pi. The image for browserless in docker not compatible with raspberrypi processor.

Using npx and with --use-chrome flag seems working as there is installer for local chrome and chromium in raspberry pi

smashah commented 3 years ago

@hafriz you can set -e WA_RASPI=true using the latest docker image