0% found this document useful (0 votes)
2 views4 pages

Static HTML Website Using Nginx Project

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views4 pages

Static HTML Website Using Nginx Project

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Static HTML Website using Nginx

STEP 1 — Update Ubuntu

sudo apt update && sudo apt upgrade -y

STEP 2 — Install Docker

sudo apt install [Link] -y

STEP 3 — Start Docker

sudo systemctl start docker

STEP 4 — Enable Docker

sudo systemctl enable docker

STEP 5 — Create Project Folder

mkdir static-project

cd static-project

STEP 6 — Create HTML File

nano [Link]

<!DOCTYPE html>

<html>

<head>

<title>My Docker Website</title>

<style>

body {

background-color: black;

color: white;

text-align: center;

padding-top: 100px;

font-family: Arial;
}

</style>

</head>

<body>

<h1>Docker Nginx Website Running on AWS EC2</h1>

<p>Hosted using Docker + Nginx</p>

</body>

</html>

STEP 9 — Save HTML File

CTRL + O

ENTER

CTRL + X

STEP 10 — Create Dockerfile

nano Dockerfile

FROM nginx:latest

COPY [Link] /usr/share/nginx/html/[Link]

STEP 12 — Save Dockerfile

CTRL + O

ENTER

CTRL + X

STEP 13 — Build Docker Image

sudo docker build -t my-nginx-site .

STEP 14 — Check Docker Images

sudo docker images


STEP 15 — Run Docker Container

sudo docker run -d -p 80:80 --name nginx-container my-nginx-site

STEP 16 — Check Running Container

sudo docker ps

STEP 17 — Open Website

Go to AWS EC2 Dashboard

Copy Public IPv4 Address

Open Browser

[Link]

You might also like