DEV Community

Discussion on: How to deploy React JS and Node.js apps on a single DigitalOcean droplet using Nginx

Collapse
 
hkrogstie profile image
Håvard Krogstie

Very cool, I did something similar with Apache, wish I had this guide, would have used Nginx instead. I wanted Continuous Deployment so I set up a GitLab webhook to trigger an additional python server on the same digital ocean droplet, which would then download the site and server as build artifacts, and start the server. The server got its own user and home directory as a security measure, but I'm not sure how much added security that actually provides.

One tip: I don't know how pm2 works, but I ended up running the python server on startup in a detached tmux session, which in turn starts the backend. This means i can check in on it using

sudo tmux attach -t manager
Enter fullscreen mode Exit fullscreen mode

Which was very nice when debugging webhooks

Collapse
 
zeeshanhshaheen profile image
Zeeshan Haider Shaheen

Yes, Nginx is very efficient and easy as compared to Apache. When I was learning Apache I found some problems in understanding particular things.
But Nginx is more easy than that.

As far as PM2, I just want to make sure that my apps is running after even if I logged out. So PM2 helps me out in this regard.

I was learning about Python server. It was quite interesting. Thanks for mentioning that..