3

I was deploying a react js website on the Linux app service on Azure. But its not getting deployed on the app service. I have used the pm2 command to run the app on linux environment

pm2 serve /home/site/wwwroot/ --no-daemon

But in the error logs its giving the error of pm2 not found.And the following one

Container didn't respond to HTTP pings on port: 8080, failing site start.

Container for site has exited, failing site start

Sushant Kargwal
  • 91
  • 2
  • 10
  • Do you want to deploy in a production style? You should run `npm run build`. Then copy the built files onto your server. – NanoBit Apr 21 '21 at 11:00
  • Yes i have already run that command in my release build and create a react app build. But at the time of deployment on the azure app service it gives me the error. – Sushant Kargwal Apr 21 '21 at 11:13
  • If my reply is helpful, please accept it as answer(click on the mark option beside the reply to toggle it from greyed out to fill in.), see https://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work – Doris Lv Apr 29 '21 at 06:35

1 Answers1

3

Navigate to the Configuration page of your web app, and add this command to Startup Command :

npx serve -s

enter image description here

Doris Lv
  • 2,870
  • 1
  • 4
  • 14