• Что бы вступить в ряды "Принятый кодер" Вам нужно:
    Написать 10 полезных сообщений или тем и Получить 10 симпатий.
    Для того кто не хочет терять время,может пожертвовать средства для поддержки сервеса, и вступить в ряды VIP на месяц, дополнительная информация в лс.

  • Пользаватели которые будут спамить, уходят в бан без предупреждения. Спам сообщения определяется администрацией и модератором.

  • Гость, Что бы Вы хотели увидеть на нашем Форуме? Изложить свои идеи и пожелания по улучшению форума Вы можете поделиться с нами здесь. ----> Перейдите сюда
  • Все пользователи не прошедшие проверку электронной почты будут заблокированы. Все вопросы с разблокировкой обращайтесь по адресу электронной почте : info@guardianelinks.com . Не пришло сообщение о проверке или о сбросе также сообщите нам.

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

Lomanu4 Оффлайн

Lomanu4

Команда форума
Администратор
Регистрация
1 Мар 2015
Сообщения
1,481
Баллы
155
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

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 <account-id>.dkr.ecr.us-east-1.amazonaws.com

# Tag and push
docker tag doot-backend <account-id>.dkr.ecr.us-east-1.amazonaws.com/doot-backend
docker push <account-id>.dkr.ecr.us-east-1.amazonaws.com/doot-backend
☁ Deploying with Amazon ECS + Fargate


Here’s where the magic happened:

? Step 1: Create ECS Cluster


Created a new cluster using Fargate launch type. No EC2 instances needed!

? Step 2: Task Definitions


Defined a task for both the frontend and backend:

  • ECR container image
  • Port mappings
  • Memory/CPU settings
? Step 3: ECS Services


Deployed tasks as services, enabling auto-restarts, load balancing (optional), and easier scaling.

? Step 4: Networking & Security

  • Placed tasks in public subnets
  • Enabled auto-assign public IP
  • Allowed traffic on ports 80 (frontend) and 3000 (backend) using security groups
Going Live


Once deployed, I could access the React frontend via the public IP of the ECS task. It successfully made API calls to the backend.

The satisfaction of seeing everything work together — no server to maintain, fully cloud-native — was amazing.

Key Takeaways

  • Fargate removes the burden of server management.
  • Properly configuring networking and security groups is crucial.
  • Dockerizing both frontend and backend simplifies deployment.
  • Amazon ECR is a reliable and scalable container registry.
  • You don't have to be a cloud expert to get started — just patient and persistent.
Final Thoughts


This project was more than just deploying an app — it was about leveling up.

I bridged the gap between development and DevOps, and it deepened my confidence in building, shipping, and scaling full-stack applications in a modern, cloud-native way.


Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.

 
Вверх Снизу