Make services-up use PROJECT_ROOT for compose paths

This commit is contained in:
beatz174-bit
2026-04-13 08:23:36 +10:00
parent 01279edc5b
commit 1a65661474
+12 -5
View File
@@ -2,21 +2,28 @@
set -euo pipefail set -euo pipefail
ENV="default-environment.env" PROJECT_ROOT="${PROJECT_ROOT:-/compose}"
SECRETS="secrets/stack-secrets.env" ENV="$PROJECT_ROOT/default-environment.env"
SECRETS="$PROJECT_ROOT/secrets/stack-secrets.env"
PROJECT="core" PROJECT="core"
FILES=( FILES=(
-f default-network.yml -f "$PROJECT_ROOT/default-network.yml"
) )
while IFS= read -r file; do while IFS= read -r file; do
FILES+=(-f "$file") FILES+=(-f "$file")
done < <( done < <(
find apps monitoring core \ find "$PROJECT_ROOT/apps" "$PROJECT_ROOT/monitoring" "$PROJECT_ROOT/core" \
-type f \ -type f \
\( -name 'docker-compose.yml' -o -name 'docker-compose.yaml' \) \ \( -name 'docker-compose.yml' -o -name 'docker-compose.yaml' \) \
| sort | sort
) )
docker compose -p "$PROJECT" --env-file "$ENV" --env-file "$SECRETS" "${FILES[@]}" "$@" docker compose \
--project-directory "$PROJECT_ROOT" \
-p "$PROJECT" \
--env-file "$ENV" \
--env-file "$SECRETS" \
"${FILES[@]}" \
"$@"