AWS ECS Ready•Dual Container Fargate Architecture
Independent Containers.
Unified Cloud Power.
Enterprise-ready architecture combining a high-speed FastAPI Python backend and modern Next.js frontend. Containerized separately with multi-stage Docker builds and configured for seamless deployment to AWS ECS Fargate.
FastAPI Service
Async Python 3.11, Uvicorn, Pydantic validation, ALB healthcheck.
Next.js 14 Service
Standalone container build, App Router, optimized static assets.
AWS ECS Fargate
Serverless container execution with independent auto-scaling.
Application Load Balancer
Path routing:
/api/* to FastAPI, /* to Next.js.Interactive API Testing Console
Send an asynchronous HTTP POST payload directly to POST /api/v1/echo to test container-to-container serialization and CORS.
Infrastructure Blueprint
AWS ECS Fargate Dual-Service Architecture
Designed for high availability, zero-downtime rolling deployments, and decoupled scaling. Both services run in independent Docker containers orchestrated by AWS ECS.
1. Ingress & Routing
AWS Application Load Balancer
A single public ALB routes traffic using intelligent path-pattern matching:
Path: /* ➔ Frontend Target Group (Port 3000)
Path: /api/* ➔ Backend Target Group (Port 8000)
Path: /health ➔ ALB Health Check (200 OK)
2. Frontend Service
Next.js Standalone • Port 3000
- Multi-stage Dockerfile produces lean standalone container (~110MB).
- Runs as unprivileged user
nextjs:nodejs. - Deployed on AWS Fargate in private subnet.
- Scales independently based on web traffic.
Image: cloudcore-frontend:latest
3. Backend Service
FastAPI Uvicorn • Port 8000
- Python 3.11-slim Dockerfile with non-root
appuser. - Built-in Docker & ALB health check at
/health. - Pydantic data schemas, automatic OpenAPI JSON docs.
- Dedicated CPU/Memory allocations on Fargate.
Image: cloudcore-backend:latest