Skip to content

Instantly share code, notes, and snippets.

@ezmac
Created July 11, 2015 00:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ezmac/bf976ebff45388473713 to your computer and use it in GitHub Desktop.
Save ezmac/bf976ebff45388473713 to your computer and use it in GitHub Desktop.
docker run script for slightly less annoying container dev.
#!/bin/bash
pwd=$(printf '%q\n' "${PWD##*/}")
if [ -z $env ]; then
echo "PROD"
#prod use absolute paths here
docker run --name $pwd -i -t -p 80:80 -p 443:443 -v /data/logs:/data/logs:rw -v /data/containers/docker-nginx-front/config/:/data/config/:rw $pwd
elif [[ $env="dev" ]]; then
#dev
echo $env
docker run --name $pwd -i -t -p 8088:80 -v `pwd`/logs/:/data/logs/:rw -v `pwd`/config/:/data/config/:rw -v `pwd`/www:/data/www:rw $pwd
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment