Deploy and Secure a React — Flask App With Docker and Nginx

Deployment and SSL encryption made easy

Ahmed Besbes
The Startup

--

Original image: here

Today we’ll use Docker and Docker-compose to deploy a secure web application on AWS.

We’ll cover:

  • Building a simple React front-end using the Material-UI library and serving it with NGINX
  • Designing a Flask API that receives data from the front-end
  • Setting up a domain name and a free SSL certificate

We’ll make things very simple to understand how these components interact with each other. Here’s what the app looks like.

Pretty simple form, right?

Let’s get started!

Launch a VM with a static public IP on AWS

For the purpose of this tutorial, I used a small t2-micro ec2 instance. It’s good enough and also eligible for the free-tier.
Once your VM is up and running, you’ll need to:

  • assing a security group to allow inbound HTTP and HTTPS traffic

--

--

Ahmed Besbes
The Startup

Medium Top Writer (+2M views) | I write about python and productionizing ML code into scalable apps. Exclusive content here: https://thetechbuffet.substack.com/