DEV Community

Discussion on: Dockerize a React app with Node.js backend connected to MongoDb

Collapse
 
ntzamos profile image
Nikos Tzamos

Thank you for your article, you help us a lot.
I wonder if instead of nginx we can serve the ui from nodejs via Express and have it all in one Docker once more.

Also, if we don't use any other interface with the api, could the api be replaced by socket.io to directly connect the react ui with nodejs.

I hope I make any sense, as I am thinking of deploying small CRUD apps with MERN stack.

Cheers

Collapse
 
misterhtmlcss profile image
Roger K.

You use Nginx because it acts as a proxy between the internet and your back end if I recall the reasoning. So it's a security issue and that's why most projects with this stack typically involve Nginx.

Some comments have been hidden by the post's author - find out more