manage, also recognize compose.yml files.

This commit is contained in:
me committed 2026-10-29 20:59:05 -07:00
1 parent 94273679d8
commit 623d855cf6
1 file changed
+9 -8
+9 -8
View File
@@ -151,13 +151,14 @@ if [[ -n $up || -n $down || -n $build || -n $pull || -n $maintenance ]]; then
pwd
# Ensure env file exists so that all compose variables are populated.
if [[ -e "./example.env" && ! -e "./.env" && -f "docker-compose.yml" ]]; then
if [[ -e "./example.env" && ! -e "./.env" &&
( -f "docker-compose.yml" || -f "compose.yml" ]]; then
echo "WARNING: .env file was not found, copying example as placeholder."
cp -v example.env .env
fi
# Ensure all configuration files have been created.
if [[ -d "./config" && -f "docker-compose.yml" ]]; then
if [[ -d "./config" && (-f "docker-compose.yml" || -f "compose.yml") ]]; then
ls ./config/*.example 2>/dev/null | while read example; do
real=${example//.example/}
if [[ ! -e $real ]]; then
@@ -168,12 +169,12 @@ if [[ -n $up || -n $down || -n $build || -n $pull || -n $maintenance ]]; then
fi
# Run the prep script to create any necessary volumes.
if [[ -f "prep.sh" && -f "docker-compose.yml" ]]; then
if [[ -f "prep.sh" && (-f "docker-compose.yml" || -f "compose.yml") ]]; then
./prep.sh
fi
# Run any maintenance scripts associated with the container.
if [[ "$maintenance" == "Y" && -f "docker-compose.yml" ]]; then
if [[ "$maintenance" == "Y" && (-f "docker-compose.yml" || -f "compose.yml") ]]; then
if [[ -f "maintenance.sh" ]]; then
./maintenance.sh
fi
@@ -184,22 +185,22 @@ if [[ -n $up || -n $down || -n $build || -n $pull || -n $maintenance ]]; then
# Update container from remote source such as Docker Hub.
if [[ $pull == "Y" ]]; then
[ -e docker-compose.yml ] && docker compose pull
[[ -f "docker-compose.yml" || -f "compose.yml" ]] && docker compose pull
fi
# Execute commands within the container's Dockerfile.
if [[ $build == "Y" ]]; then
[ -e Dockerfile ] && docker compose build
[[ -e Dockerfile ]] && docker compose build
fi
# Shut off container.
if [[ $down == "Y" ]]; then
[ -e docker-compose.yml ] && docker compose down
[[ -f "docker-compose.yml" || -f "compose.yml" ]] && docker compose down
fi
# Run the container as a daemon.
if [[ $up == "Y" ]]; then
[ -e docker-compose.yml ] && docker compose up -d
[[ -f "docker-compose.yml" || -f "compose.yml" ]] && docker compose up -d
fi
cd ..