Last active
January 5, 2019 10:20
-
-
Save peterkappus/c45b2bb3ea53e9d756fbe806947dffb3 to your computer and use it in GitHub Desktop.
Use docker to host a local html file with nginx!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# What is it? Use docker to host an html file using nginx! | |
# Pre-requisites: You've installed docker and logged into docker-hub | |
#make our html file | |
echo "<h1>Hello world</h1>" > index.html | |
#start docker and mount our current working directory into nginx | |
docker run -p 80:80 -v "$(PWD)":/usr/share/nginx/html:ro -d nginx | |
#go have a look! | |
open http://localhost | |
#make some changes to the HTML file in the host and reload to see your changes in real-time |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment