dockerdev.sh (431B)
1 #!/bin/bash 2 3 # If 'serve' arg is given, a port is actually exposed, otherwise the host 4 # is responsible for the server 5 if [ "$1" == "serve" ]; then 6 port=$2 7 if [ -z "$port" ]; then 8 port=8080 9 fi 10 port_arg="-p $port:8080" 11 docker run -it -p $port:8080 -u $UID -v $PWD:/vue -w /vue node:alpine npm run serve 12 fi 13 14 docker run -it -p $PORT:8080 -u $UID -v $PWD:/vue -w /vue node:alpine \ 15 npm run build-dev