Skip to content

Step by Step instructions to build and run a simple static HTML site with Docker and Nginx

License

Notifications You must be signed in to change notification settings

ameyrupji-k8s/docker-nginx-static-html-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

◂ Previous

docker-nginx-static-html-demo

Prerequisites

  • docker installed

System Configuration at time of test

  • macOS Mojave - Version 10.14.5
  • Docker Desktop - Version 2.0.0.3 (31259)

Build Image

To build the docker image run the following command on the terminal: docker build -t nginx-static-html-image:v1 .

To list the created docker images run the command on the terminal: docker images

docker-nginx-static-html-demo-docker-list-image

Run the Docker Container

Run the following command to spin up the container server: docker run -d -p 45678:80 nginx-static-html-image:v1

To list all the containers running run this command on the terminal: docker ps -a

docker-nginx-static-html-demo-list-container-image

Test

Run the following command to ensure the server is running: curl localhost:45678

You can also view it in the browser by going to localhost:45678 and the HTML page similar the the one below will show up:

docker-nginx-static-html-demo-browser-image

Cleanup

To stop the container that is running use this command: docker stop {container_id}

To delete the container that was created use this command: docker rm {container_id}

To delete the docker image that was created: docker rmi {image_id}

docker-nginx-static-html-demo-cleanup-image

Next ▸

About

Step by Step instructions to build and run a simple static HTML site with Docker and Nginx

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published