Last active
February 7, 2022 14:34
-
-
Save hugoheden/a91a16b7e1e46dee4f0cc9fe2687df7c to your computer and use it in GitHub Desktop.
A simple one-off nginx: Use nginx in docker to serve a single file without any special configuration.
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
# This should make your file accessible on http://localhost:9080 | |
# File is given as command line parameter. Expects relative path from current directory. | |
THE_FILE=$1 | |
# File is served on port 9080. | |
docker run -it --rm -p 9080:80 -v "$(pwd)/$THE_FILE":"/usr/share/nginx/html/$THE_FILE" nginx:latest |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment