Last active
February 11, 2024 01:28
-
-
Save atheiman/ee5a9a57e426ba40d23e1d4e4c5a111f to your computer and use it in GitHub Desktop.
Run nginx in docker container to serve PWD
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
# Run nginx docker container in background | |
docker run --name nginx --rm -d -p 8080:80 -v ${PWD}:/usr/share/nginx/html:ro nginx | |
# Load a file in curent directory | |
curl http://localhost:8080/index.html | |
# Stop the docker container (the container will be removed / cleaned up) | |
docker stop nginx |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment