Last active
May 22, 2019 07:54
-
-
Save spacelatte/d07e5d1f1ecce5be7c61d81bacdfae27 to your computer and use it in GitHub Desktop.
react docker bash quick start
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
#!/bin/bash | |
which docker > /dev/null || { | |
echo "Docker not found! which is required!" | |
exit 1 | |
} | |
test -z "$1" && { | |
echo "Easy Usage: $0 app-name [port]" 1>&2 | |
docker run --rm -itv "$(pwd):/data" -p 9005:9005 -p ${PORT:-3000}:3000 pvtmert/react | |
exit | |
} | |
APPNAME=${1:-test} | |
PORT=${2:-3000} | |
test -e "$APPNAME" || docker run --rm -itv "$(pwd):/data" -p $PORT:3000 pvtmert/react create-react-app "$APPNAME" | |
docker run --rm -itv "$(pwd)/$APPNAME:/data" -p $PORT:3000 pvtmert/react yarn start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment