This repository has been archived on 2022-02-20. You can view files and clone it, but cannot push or open issues/pull-requests.
bash-shell-host/all/misc/docker/docker-compose

31 lines
608 B
Plaintext
Raw Permalink Normal View History

#!/bin/bash
# only source if docker and docker_compose are installed
command -v docker >/dev/null 2>&1 || return
command -v docker-compose >/dev/null 2>&1 || return
function dkcmp () {
DIR=/opt/containers/$1
cd $DIR || return
case $2 in
start )
docker-compose up -d
;;
stop )
docker-compose down
;;
remove )
docker volume ls | grep $1
docker-compose rm -s -v
;;
restart )
docker-compose down
docker-compose up -d
;;
make )
docker-compose up -d --force-recreate
;;
esac
cd - >/dev/null 2>&1 || return
}