This project was created for This article.
Note the startscript.sh is a production start script. It builds react app for production.
$ git clone https://github.com/mty-tidjani/react-node-deploy-single-port.git demo
you will need to terminal to run client and server in dev mode.
$ cd ./demo/client
$ yarn
$ yarn start
React app should be running on http://localhost:3000
$ cd ./demo/server
$ yarn
$ yarn start
Node app should be running on http://localhost:4000
Give sufficient rights to startscript.sh and
$ ./startscript.sh
Move your project into your server and
$ docker-compose up -d
And you got your react/node app running on one port (4000). You can now add the necessary config (nginx, apache or any other) to proxy your domain name to http://localhost:4000.
Give it a star if you found it useful