You’ve built a React app, but now you need to deploy it. What do you do? First, it’s probably best to choose a cloud provider as they’re typically low-cost and easy to deploy to.
Most cloud providers offer a way to deploy a static site. A built React app is just JavaScript, HTML, and CSS. They’re static files that can live on pretty much any web server. In fact, with JSX (HTML in JS) and Styled Components, you could even say it’s just JavaScript!
Docker is the de facto standard to build and share containerized applications. You can use it to package your apps and include many open source web servers to serve up your app. As an added bonus, you can configure the webserver to send security headers that make your app more secure.
Create a React App
Why Docker?
Create a Dockerfile and Nginx Configuration
Build a Docker Image with Your React App
Run Your Docker + React App
Deploy Your React App to Heroku
Deploy Your Docker + React App to Heroku
Use Cloud Native Buildpacks to Create Your React + Docker Image
Deploy Your React + Docker Image to Docker Hub
Deploy Your React + Docker Image to Heroku
#react #docker #security