Created
May 7, 2020 06:17
-
-
Save ryantate13/4e97129bff63d8d758aa4db7648e8a90 to your computer and use it in GitHub Desktop.
`serve` zsh alias
This file contains 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
serve () { | |
local port="${2:-80}" | |
port=$(echo $port | sed s/://g) | |
echo now serving traffic on http://localhost:$port | |
sudo docker run -it --rm -v $(realpath $1):/usr/share/nginx/html -p "$port":80 nginx:alpine | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment