Skip to content

Instantly share code, notes, and snippets.

@meigwilym
Created March 17, 2020 10:53
Show Gist options
  • Save meigwilym/8be84780a94e149407316410c8f50dae to your computer and use it in GitHub Desktop.
Save meigwilym/8be84780a94e149407316410c8f50dae to your computer and use it in GitHub Desktop.
Bash file to manage a simple docker nginx server
#!/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