Skip to content

devdrop-gc/docker-nginx-webapp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ Containerized Web Application Deployment using Docker and AWS

A containerized static web application deployed on AWS EC2 using Docker and NGINX, showcasing a DevOps workflow including Docker image build, Docker Hub registry, and cloud deployment.


πŸ“Œ Project Overview

This project demonstrates how to containerize and deploy a static web application using Docker on AWS cloud infrastructure.

The objective is to showcase a simple DevOps deployment workflow where:

  • A web application is created using HTML, CSS, and JavaScript
  • The application is containerized using Docker
  • The container image is stored in Docker Hub
  • The container is deployed on an AWS EC2 server
  • The application is served using NGINX
  • End users can access the website through the public internet

This project demonstrates key concepts used in modern DevOps and Cloud Engineering workflows.


🧰 Technologies Used

Technology Purpose
🐳 Docker Containerization platform
🌐 NGINX Web server to serve static files
☁ AWS EC2 Cloud virtual machine
πŸ“¦ Docker Hub Container image registry
πŸ—‚ GitHub Source code management
πŸ’» HTML / CSS / JS Frontend web application

πŸ“‚ Project Structure

docker-nginx-webapp/
β”‚
β”œβ”€β”€ architecture
β”‚   └── architecture-diagram.png
β”‚
β”œβ”€β”€ screenshots/
β”‚   β”œβ”€β”€ website-live.png
β”‚   β”œβ”€β”€ complete-webpage.png
β”‚   β”œβ”€β”€ docker-build.png
β”‚   β”œβ”€β”€ docker-images.png
β”‚   β”œβ”€β”€ docker-container-running.png
β”‚   β”œβ”€β”€ ec2-instance-running.png
β”‚   β”œβ”€β”€ security-group-rules.png
β”‚   β”œβ”€β”€ ssh-login.png
β”‚   └── dockerhub-image.png
β”‚
β”œβ”€β”€ css
β”‚   └── styles.css
β”œβ”€β”€ js
β”‚   └── script.js
β”œβ”€β”€ Dockerfile
β”œβ”€β”€ index.html
└── README.md


πŸ— Architecture

The project follows a containerized cloud deployment architecture.

Architecture Diagram


πŸ”„ Architecture Flow

  1. Developer writes application code on local machine

  2. Code is pushed to GitHub repository

  3. Docker builds the container image using a Dockerfile

  4. Image is pushed to Docker Hub registry

  5. AWS EC2 instance is launched

  6. Docker engine is installed on the EC2 server

  7. EC2 pulls the Docker image from Docker Hub

  8. Docker container starts running on EC2

  9. NGINX serves the static web application

  10. End users access the website through the EC2 Public IP


🧱 Architecture Components

πŸ‘¨β€πŸ’» Developer Laptop

The developer writes and manages the web application source code locally.

πŸ™ GitHub Repository

GitHub is used for version control and source code management.

🐳 Docker Build Stage

The Dockerfile defines how the application is packaged into a container image.

πŸ“¦ Docker Hub

Docker Hub stores the container image and allows it to be pulled by servers.

☁ AWS EC2 Instance

An EC2 virtual machine hosts the Docker engine and runs the application container.

βš™ Docker Engine

Docker Engine manages container lifecycle on the server.

🌐 NGINX Container

NGINX serves the static website files inside the Docker container.

πŸ‘₯ End Users

Users access the deployed website through the EC2 public IP address.


πŸ“Έ Screenshots

🌍 Live Website

Live Website

Full Webpage Design Complete Webpage


☁ EC2 Instance Running

ec2 instance


πŸ” Security Group Configuration

security group


πŸ”‘ SSH Connection to Server

SSH connection


🐳 Docker Image Build

Docker Image Build


πŸ“¦ Docker Images

Docker Images


β–Ά Running Docker Container

Running Docker Container


πŸ“¦ Docker Hub Repository

Docker Hub Repository


πŸ” Security Best Practices Implemented

This project follows several basic cloud security practices:

  • SSH key-based authentication
  • Restricted inbound rules in AWS Security Groups
  • Only required ports opened (22 and 80)
  • Containerized environment for application isolation
  • Minimal NGINX base image used

These practices reduce the attack surface of the deployed infrastructure.


πŸ’° Cost Considerations

This project was deployed using the AWS Free Tier.

Cost optimization steps:

  • Used t3.micro EC2 instance
  • Stopped EC2 instance when not in use
  • Used Docker Hub free registry
  • Avoided additional AWS paid services

Estimated cost: $0 within Free Tier limits


πŸ“ˆ Future Improvements

This project can be extended with more advanced DevOps practices:

  • Implement CI/CD using GitHub Actions
  • Automate deployments using AWS CodePipeline
  • Add custom domain with Route53
  • Enable HTTPS using AWS Certificate Manager
  • Deploy infrastructure using Terraform
  • Implement Docker Compose
  • Add Monitoring and Logging

These improvements would transform the project into a production-level DevOps pipeline.


🧠 Key Learnings

Through this project, the following concepts were learned:

  • Docker containerization
  • Writing Dockerfiles
  • Managing container images
  • Using Docker Hub registry
  • Deploying applications on AWS EC2
  • Configuring security groups
  • Running containers on cloud servers
  • Hosting web applications using NGINX

This project provided hands-on experience with real-world DevOps workflows.


🏁 Conclusion

This project demonstrates how a simple web application can be containerized and deployed on cloud infrastructure using Docker and AWS.

By combining containerization with cloud services, application deployment becomes:

  • Portable
  • Scalable
  • Consistent

These are essential principles in modern DevOps and cloud-native development.


About

A containerized static web application deployed on AWS EC2 using Docker and NGINX, showcasing a beginner-friendly DevOps workflow including Docker image build, Docker Hub registry, and cloud deployment.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors