Compare commits

...
2 Commits
Author SHA1 Message Date
me 64f90acffd create, use compose.yml from now on. 2026-10-29 20:59:24 -07:00
me 623d855cf6 manage, also recognize compose.yml files. 2026-10-29 20:59:05 -07:00
2 changed files with 10 additions and 9 deletions

No files matched your search

+1 -1
View File
@@ -30,7 +30,7 @@ fi
## Variables ##
dir="$1"
file="$dir/docker-compose.yml"
file="$dir/compose.yml"
## Main ##
+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 ..