Skip to content

Instantly share code, notes, and snippets.

@PortNumber53
Last active February 24, 2019 18:56
Show Gist options
  • Save PortNumber53/5bb39f827b1ae72b16459379d263128c to your computer and use it in GitHub Desktop.
Save PortNumber53/5bb39f827b1ae72b16459379d263128c to your computer and use it in GitHub Desktop.
docker-compose function
function dc() {
COMMAND="docker-compose"
if [ -e ./docker-compose.yml ]; then
COMMAND="${COMMAND} -f docker-compose.yml"
fi
if [[ -a ./docker-compose.dev.yml ]]; then
COMMAND="${COMMAND} -f docker-compose.dev.yml"
fi
if [ -e ./docker/docker-compose.yml ]; then
COMMAND="${COMMAND} -f docker/docker-compose.yml"
fi
if [[ -a ./docker-compose.dev-yml ]]; then
COMMAND="${COMMAND} -f docker-compose-dev.yml"
fi
if [[ -a ./docker/docker-compose-dev.yml ]]; then
COMMAND="${COMMAND} -f docker/docker-compose-dev.yml"
fi
if [[ -a ./docker-compose.wdio.yml ]]; then
COMMAND="${COMMAND} -f docker-compose.wdio.yml"
fi
if [[ -a ./docker-compose.aws-dev.yml ]]; then
COMMAND="${COMMAND} -f docker-compose.aws-dev.yml"
fi
echo ${COMMAND}
eval "${COMMAND} $@"
# docker-compose -f docker-compose.yml -f docker-compose.dev.yml -f docker-compose.wdio.yml -f docker-compose.aws-dev.yml $@
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment