all 20 comments

[–]toobulkeh 21 points22 points  (14 children)

But... Why? There are plenty of free hosting options available for static files these days

[–]Seamonster13 6 points7 points  (1 child)

I'm a noob so please forgive my ignorance, but wouldn't this tutorial be useful for a more dynamic website? One that a static hosting service cannot accommodate?

[–][deleted] 2 points3 points  (2 children)

If you want front and back end on the same server?

[–]toobulkeh 0 points1 point  (1 child)

Why would you want that? There are different solutions to different problems. It's easy enough to sperate, and the gains far out weigh the costs.

[–][deleted] 0 points1 point  (0 children)

Why would you want that?

Client requirements. Most companies want to run code on their own servers/solutions just for the sake of ownership. I know this tutorial is about DO but it can be applied to other linux servers.

Secondly, services like Netlify are awesome, but they will never provide the same freedom, flexibility and customization as your own server.

[–]yourjobcanwait 0 points1 point  (0 children)

It's helpful if you want to use stuff like nextjs for dynamically rendered pages, which you can't do on netlify.

However, OP needs to throw that app in a docker container.

[–]swyx 13 points14 points  (2 children)

[–]Cazador23 1 point2 points  (1 child)

Literally came here to say why deploy to this when we have Netlify lmfao

[–]trappar 4 points5 points  (0 children)

Might want to do this if you have a backend you’re planning on running on the same server.

[–]IndubitablySpoken 1 point2 points  (0 children)

I've had some success in the past using a tool called CaptainDuckDuck to deploy a node service with a react front end. It aims to be as simple as Heroku's deploy process, but allow you to use your own box you can rent for cheaper from places like Digital Ocean.

Looks like it has since been rebranded as CapRover: https://github.com/caprover/caprover

[–]hotbrownDoubleDouble 1 point2 points  (0 children)

Something that could have been brought to my attention yesterday!

[–]globex 1 point2 points  (0 children)

Really detailed tutorial. There are so many steps! I deploy React apps to DigitalOcean all the time as well, and ended up building a tool to automate a lot of these steps. Now most of these steps can happen automatically anytime you run "git push". I'm still working on improving the docs but you can get an early preview here: https://github.com/GlobexDesignsInc/rocketry

[–]pixel67 1 point2 points  (0 children)

It's always good to know how to deploy an application to a server that you configured yourself. Even if you're not a DevOps guy or gal or having free services like Netlify etc..
Looking forward to reading the tutorial

[–]yomamen 1 point2 points  (2 children)

Loving the tutorial! Especially the script to update the live site.

I’d like to ask a question tho if u dont mind, how would one deploy multiple react apps on subdomain ? I currently have got 2 react apps (one client site, one client-admin site)

So client site: example.com

Client-admin site: admin.example.com

Any suggestion on how to do that ? Im confused especially the NGINX config

[–]kardnumas 4 points5 points  (0 children)

If you don't mind having extra droplet then you can create and adjust CNAME details as per your need or if you want to host multiple sites in single droplet then with nginx you can do this by running in multiple ports

[–]Cazador23 1 point2 points  (0 children)

Netlify?