I have a weird problem I've been scratching my head over. I have an express app which uses pm2 in production mode
cross-env NODE_ENV=production pm2 start ./src/index.js
This works perfectly fine locally. However when I deploy this to Azure App service, the container keeps crashing. I can see the pm2 process starting successfully in the logs but the app then crashes with the following error message
Container didn't respond to pings on port 8080
I have tried setting WEBSITES_PORT to 8080 and I've tried using process.env.PORT and hard coding the port to 8080 but nothing has worked.
Does anyone know what might be the cause? I prefer not having to run the application against node in production.
Update I just tried this with supervisor and had the same result. Looks like there is something about process managers that's a problem here, maybe?