Skip to content

Instantly share code, notes, and snippets.

@atheiman
Last active February 11, 2024 01:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save atheiman/ee5a9a57e426ba40d23e1d4e4c5a111f to your computer and use it in GitHub Desktop.
Save atheiman/ee5a9a57e426ba40d23e1d4e4c5a111f to your computer and use it in GitHub Desktop.
Run nginx in docker container to serve PWD
# 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