#!/bin/bash # restart services in docker-compose service-restart() { docker-compose stop $@ docker-compose rm -f -v $@ docker-compose up --force-recreate --no-start $@ docker-compose start $@ } if [ $# -eq 0 ]; then echo "" echo "you must include the name of a docker-compose service" echo "you must be in a directory where a suitable configuration file in this directory or any parent." echo "Supported filenames: docker-compose.yml, docker-compose.yaml" echo "" exit 1 fi for f in $PWD/docker-compose.y*; do if [ -e "$f" ]; then # echo "supported files found" service-restart $@ else echo "you must be in a directory where a suitable configuration file in this directory or any parent." exit 1 fi break done