A production-grade, containerized full-stack web application deployed entirely on Amazon Web Services (AWS). This repository is primarily a showcase of advanced DevOps engineering, emphasizing scalable cloud infrastructure, strict network security, and highly optimized multi-stage container builds.
- Application Load Balancer URL: http://docker-aws-practice-alb-1169726276.ap-northeast-1.elb.amazonaws.com/
This project moves beyond local development to demonstrate how modern applications are architected for high availability and security in the cloud.
- Multi-Stage Builds: Engineered a layered
Dockerfileto separate the build environment from the runtime environment. The frontend is compiled in an isolated Node container, and only the finalized static assets (/dist) are injected into the backend serving container. This drastically reduces the final image size and attack surface. - Cross-Platform Compilation: Utilized
docker buildxwith the--platform linux/amd64flag to ensure the image architecture perfectly matches the AWS cloud hardware, eliminating local-to-cloud architecture mismatch errors. - Cache & Context Optimization: Implemented strict
.dockerignorerules to prevent localnode_modulesand environment variables from polluting the container registry.
- Elastic Container Registry (ECR): Secured private registry for storing and versioning the compiled production images.
- Elastic Container Service (ECS) with Fargate: Deployed the container using AWS Fargate for a fully serverless execution layer, removing the operational overhead of provisioning and managing underlying EC2 instances.
- Granular IAM Security: Configured strict Identity and Access Management (IAM) policies. Separated Task Execution Roles (allowing ECS to pull from ECR) from Task Roles (application-level permissions) to adhere to the Principle of Least Privilege.
- Virtual Private Cloud (VPC): Provisioned a custom VPC with dedicated public subnets attached to an Internet Gateway for isolated execution.
- Application Load Balancer (ALB): Placed an internet-facing ALB in front of the ECS cluster. The ALB safely intercepts external Port 80 traffic and forwards it to the container's internal Port 3000.
- Stateful Firewalls (Security Groups): Configured strict AWS Security Groups to drop unauthorized inbound traffic, ensuring the container instances can only be accessed via the Load Balancer.
# ---------- FRONTEND BUILD ----------
FROM node:20-alpine AS frontend-builder
WORKDIR /app
COPY frontend/package*.json ./
RUN npm install
COPY frontend .
RUN npm run build
# ---------- BACKEND BUILD ----------
FROM node:20-alpine
WORKDIR /app
COPY backend/package*.json ./
RUN npm install
COPY backend .
COPY --from=frontend-builder /app/dist ./public
EXPOSE 3000
CMD ["node", "server.js"]