How to do Production deployment of React + Nodejs?

Viewed 41

I am trying to understand how to deploy the web application with docker and do a production level deployment.

I made a web application with react as front end and Nodejs as backend. I used Mangodb for database.

I used proxy to connect both front and back-end , so that they started communicating with each other.

The web application working good as I built and API and routed through front-end.

My Goal:

To deploy using Devops and CI/CD pipelines.

With my research , the best possible options are :

  • using docker
  • using circle ci with docker

But I still havent found a way on how to deploy the entire web application .

should I deploy the front-end and back-end using docker and setup github actions? Is this the right way to deploy the applications and if so how does the front-end and back-end can talk with each other?

options: deploy both front-end and back-end with docker and figure out a way on how they communicate with each other.

My last experience was deploying backend on heroku and use that link as proxy in the front-end where I deploy it via netlify.

option 2: use circle-ci and docker combined to deploy both front-end and back-end.

Can anyone suggest the best way to approach this situation ? and best resource to lookup where I can deploy the entire web application using devops tools .

Thanks

1 Answers

I thought of sharing my experience. This could be slightly helpful to your issue.

Are you using any aws services ? For our projects, we're using aws. To deploy frontend applications, we're hosting them in S3 buckets and use cloudfront as edge locations to serve the requests. For backend, ECS cluster based on EC2 launch type is used. For backend deployment, docker is necessary to containerize each application image and create tasks in ecs cluster.

To use CI/CD, I'm using github, github web hook, codebuild and codepipeline. If any commit is made through a pull request, such changes are identified via web hook and then codebuild and codepipeline runs to build and deploy the changes to relevant environments.

Related