A free, open, self-hosted app platform (GNU AGPLv3): one-click app deploys, Traefik reverse proxy with automatic SSL, rootless Docker support, gluetun VPN routing, and a web dashboard to manage it all. Free & open forever to self-host; optional paid hosted services fund it. See PROMISE.md. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> Signed-off-by: librelad <librelad@digitalangels.vip>
59 lines
2.5 KiB
Bash
Executable File
59 lines
2.5 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
dockerComposeDown()
|
|
{
|
|
local app_name="$1"
|
|
local custom_compose="$2"
|
|
local type="$3"
|
|
|
|
if [[ "$app_name" == "" ]]; then
|
|
isError "Something went wrong...No app name provided..."
|
|
fi
|
|
|
|
isHeader "Docker Compose down $app_name"
|
|
|
|
# Make sure we are able to get the compose file
|
|
if [[ $compose_setup == "" ]]; then
|
|
setupBasicScanVariables "$app_name"
|
|
fi
|
|
|
|
# Compose file public variable for restarting etc
|
|
if [[ $compose_setup == "default" ]]; then
|
|
local setup_compose="-f docker-compose.yml"
|
|
local compose_file="docker-compose.yml"
|
|
elif [[ $compose_setup == "app" ]]; then
|
|
local setup_compose="-f docker-compose.yml -f docker-compose.$app_name.yml"
|
|
local compose_file="docker-compose.$app_name.yml"
|
|
fi
|
|
if [[ $custom_compose != "" ]]; then
|
|
local setup_compose="-f docker-compose.yml -f $custom_compose"
|
|
local compose_file="$custom_compose"
|
|
fi
|
|
|
|
if [[ "$OS_TYPE" == "Ubuntu" || "$OS_TYPE" == "Debian" ]]; then
|
|
if [ -f "$containers_dir$app_name/$compose_file" ]; then
|
|
# Used for the standard LibrePortal app
|
|
if [[ "$type" == "" ]]; then
|
|
if [[ $CFG_DOCKER_INSTALL_TYPE == "rootless" ]]; then
|
|
local result=$(dockerCommandRunInstallUser "cd $containers_dir$app_name && docker compose $setup_compose down" >/dev/null 2>&1)
|
|
checkSuccess "Shutting down container for $app_name"
|
|
elif [[ $CFG_DOCKER_INSTALL_TYPE == "rooted" ]]; then
|
|
local result=$(cd "$containers_dir$app_name" && sudo docker compose $setup_compose down >/dev/null 2>&1)
|
|
checkSuccess "Shutting down container for $app_name"
|
|
fi
|
|
# Used for the CLI dockertype switcher.
|
|
else
|
|
if [[ $type == "rootless" ]]; then
|
|
local result=$(dockerCommandRunInstallUser "cd $containers_dir$app_name && docker compose $setup_compose down" >/dev/null 2>&1)
|
|
checkSuccess "Shutting down container for $app_name"
|
|
elif [[ $type == "rooted" ]]; then
|
|
local result=$(cd "$containers_dir$app_name" && sudo docker compose $setup_compose down >/dev/null 2>&1)
|
|
checkSuccess "Shutting down container for $app_name"
|
|
fi
|
|
fi
|
|
else
|
|
isNotice "Unable to find the compose file to docker compose down this application."
|
|
fi
|
|
fi
|
|
}
|