Skip to content

About

docker project

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Static Website Deployment with Docker & Nginx on AWS EC2

A containerized static website deployment demonstrating core Docker fundamentals on a cloud-hosted Linux environment: provisioning a virtual machine, installing a container runtime, and serving content through a production-grade web server all without a single line of application code touching the host directly.

Architecture

Architecture diagram: browser to EC2 to Docker to Nginx container

 Browser (Public IP:8080)
          │
          ▼
 ┌─────────────────────────────┐
 │   AWS EC2 (Ubuntu)          │
 │                              │
 │   ┌────────────────────┐    │
 │   │  Docker Engine      │    │
 │   │                      │    │
 │   │  ┌────────────────┐ │    │
 │   │  │ nginx container │ │    │
 │   │  │  :80  ───────►  │◄┼────┼── port 8080
 │   │  └────────────────┘ │    │
 │   │         ▲            │    │
 │   └─────────┼────────────┘    │
 │              │ bind mount      │
 │      ~/website/index.html      │
 └─────────────────────────────┘

Overview

This project deploys a static HTML website inside an Nginx container running on an AWS EC2 (Ubuntu) instance. The site is served on port 8080 and reachable from any browser via the instance's public IP, with the site's source files bind-mounted from the host so updates are reflected instantly without rebuilding the image.

Stack

Component Role
AWS EC2 (Ubuntu) Host virtual machine
Docker CE Container runtime
Nginx (official image) Web server serving static content
Bind mount Live-syncs host files into the container

Key Steps

1. Provision & prepare the host Launched an Ubuntu EC2 instance and installed Docker CE via Docker's official APT repository (GPG key verification, repository registration, docker-ce + plugins), then validated the install with docker run hello-world.

Docker CE installation via official APT repository

*Docker CE and plugins installed on the EC2 instance via Docker's official APT repository.*

2. Build the site directory Created a host-side website/ directory containing index.html a styled static landing page (AWS user group event listing) written directly on the instance.

Editing index.html in Vim

*Static site source created directly on the instance.*

3. Containerize with Nginx Ran an official nginx image with the host directory bind-mounted to Nginx's default content path, publishing container port 80 to host port 8080:

docker run -it -d --name web -p 8080:80 -v ~/website:/usr/share/nginx/html nginx

Nginx container running

*Container up and port mapping confirmed via `docker ps`.*

4. Verify Accessed the site from a browser using the EC2 instance's public IP on port 8080, confirming Nginx served the mounted content correctly and that edits to index.html on the host are reflected live, with no rebuild needed.

Site live in browser

*Site served live at the EC2 instance's public IP on port 8080.*

Demo

Live demo of the deployed site

What This Demonstrates

  • Installing and configuring Docker on a cloud Linux host from scratch
  • Running and managing containers (docker run, naming, detached mode)
  • Port mapping between host and container
  • Bind mounts for live file syncing during development
  • Exposing a containerized service via a public cloud IP

Notes

  • Terminal recordings and command screenshots for each step are included in /screenshots (add folder once uploaded).
  • Architecture diagram will be finalized using official AWS and Docker icon sets.

Part of a broader DevOps learning portfolio documenting hands-on cloud and containerization projects.

About

docker project

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages