Created
May 25, 2017 05:10
-
-
Save nrempel/5adf761b7d3d4454a6a2a59cb0fb3f4a to your computer and use it in GitHub Desktop.
Example code for https://rempel.world/guides/docker-development-environment.html Raw
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 | |
set -e | |
SCRIPT_HOME="$( cd "$( dirname "$0" )" && pwd )" | |
cd $SCRIPT_HOME | |
case "$1" in | |
start) | |
docker-compose up web worker clock | |
;; | |
stop) | |
docker-compose stop | |
;; | |
build) | |
docker-compose build | |
;; | |
rebuild) | |
docker-compose build --no-cache | |
;; | |
run) | |
if [ "$#" -lt "2" ] | |
then | |
echo $"Usage: $0 $1 <command>" | |
RETVAL=1 | |
else | |
shift | |
docker-compose run shell "$@" | |
fi | |
;; | |
shell) | |
docker-compose run shell | |
;; | |
*) | |
echo $"Usage: $0 {start|stop|build|rebuild|run}" | |
RETVAL=1 | |
esac | |
cd - > /dev/null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment