31 lines
608 B
Bash
31 lines
608 B
Bash
#!/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
|
|
}
|