Deploying a Full-Stack App on AWS ECS with Docker: From Code to Cloud

In the ever-evolving world of web development, one of the most empowering things you can do is take your application from local development all the way to the cloud — and that’s exactly what I did. Over the past few days, I built and deployed a full-stack application consisting of a React frontend and an Express.js backend, fully containerized and hosted on AWS ECS using Fargate. Here’s a look behind the scenes of how I transformed lines of code into a cloud-native, production-grade deployment. The Stack Frontend: React (built with Vite) repo Backend: Node.js + Express repo Containerization: Docker Cloud Hosting: Amazon ECS with Fargate Container Registry: Amazon ECR Building the Application The architecture was simple but effective: a React frontend communicating with an Express backend. I began by developing both apps locally and testing them with Docker to ensure container compatibility. Frontend Setup Highlights Built using Vite for lightning-fast bundling Dockerized into a lightweight Nginx container Served static files from /usr/share/nginx/html Backend Setup Highlights RESTful API built with Express Dockerized using a minimal Node Alpine base image Exposed port 3000 for requests Dockerization Each app was placed in its own Docker container with production-ready configurations. # Build images docker build -t doot-frontend . docker build -t doot-backend . # Authenticate to ECR aws ecr get-login-password --region us-east-1 \ | docker login --username AWS --password-stdin .dkr.ecr.us-east-1.amazonaws.com # Tag and push docker tag doot-backend .dkr.ecr.us-east-1.amazonaws.com/doot-backend docker push .dkr.ecr.us-east-1.amazonaws.com/doot-backend ☁️ Deploying with Amazon ECS + Fargate Here’s where the magic happened:

May 14, 2025 - 22:06
 0
Deploying a Full-Stack App on AWS ECS with Docker: From Code to Cloud

In the ever-evolving world of web development, one of the most empowering things you can do is take your application from local development all the way to the cloud — and that’s exactly what I did.

Over the past few days, I built and deployed a full-stack application consisting of a React frontend and an Express.js backend, fully containerized and hosted on AWS ECS using Fargate. Here’s a look behind the scenes of how I transformed lines of code into a cloud-native, production-grade deployment.

The Stack

  • Frontend: React (built with Vite) repo
  • Backend: Node.js + Express repo
  • Containerization: Docker
  • Cloud Hosting: Amazon ECS with Fargate
  • Container Registry: Amazon ECR

Building the Application

The architecture was simple but effective: a React frontend communicating with an Express backend. I began by developing both apps locally and testing them with Docker to ensure container compatibility.

Frontend Setup Highlights

  • Built using Vite for lightning-fast bundling
  • Dockerized into a lightweight Nginx container
  • Served static files from /usr/share/nginx/html

Backend Setup Highlights

  • RESTful API built with Express
  • Dockerized using a minimal Node Alpine base image
  • Exposed port 3000 for requests

Dockerization

Each app was placed in its own Docker container with production-ready configurations.

# Build images
docker build -t doot-frontend .
docker build -t doot-backend .

# Authenticate to ECR
aws ecr get-login-password --region us-east-1 \
  | docker login --username AWS --password-stdin .dkr.ecr.us-east-1.amazonaws.com

# Tag and push
docker tag doot-backend .dkr.ecr.us-east-1.amazonaws.com/doot-backend
docker push .dkr.ecr.us-east-1.amazonaws.com/doot-backend

☁️ Deploying with Amazon ECS + Fargate

Here’s where the magic happened: