Created
March 17, 2020 10:53
-
-
Save meigwilym/8be84780a94e149407316410c8f50dae to your computer and use it in GitHub Desktop.
Bash file to manage a simple docker nginx server
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
#!/bin/bash | |
start() { | |
echo "starting the docker server..." | |
docker run --name docker-nginx -p 80:80 -d -v ~/Code/macbryde-click-map-demo:/usr/share/nginx/html nginx | |
} | |
stop() { | |
echo "stopping the docker server..." | |
docker stop docker-nginx | |
docker rm docker-nginx | |
} | |
if [ $# -gt 0 ]; then | |
if [ "$1" == "start" ]; then | |
start | |
elif [ "$1" == "stop" ]; then | |
stop | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment