fix(docker): respect docker-compose.override.yml for user customizations (#44)

all compose file assembly points now include the override file last
when present, giving it highest precedence over other compose files
This commit is contained in:
Yury Kossakovsky
2026-02-27 19:05:50 -07:00
parent 19325191c3
commit 6a1301bfc0
5 changed files with 28 additions and 1 deletions

View File

@@ -10,6 +10,7 @@
# - docker-compose.n8n-workers.yml (if exists and n8n profile active)
# - supabase/docker/docker-compose.yml (if exists and supabase profile active)
# - dify/docker/docker-compose.yaml (if exists and dify profile active)
# - docker-compose.override.yml (if exists, user overrides with highest precedence)
#
# Usage: bash scripts/restart.sh
# =============================================================================
@@ -71,6 +72,10 @@ MAIN_COMPOSE_FILES=("-f" "$PROJECT_ROOT/docker-compose.yml")
if path=$(get_n8n_workers_compose); then
MAIN_COMPOSE_FILES+=("-f" "$path")
fi
OVERRIDE_COMPOSE="$PROJECT_ROOT/docker-compose.override.yml"
if [ -f "$OVERRIDE_COMPOSE" ]; then
MAIN_COMPOSE_FILES+=("-f" "$OVERRIDE_COMPOSE")
fi
# Start main services
log_info "Starting main services..."

View File

@@ -353,6 +353,7 @@ get_dify_compose() {
}
# Build array of all active compose files (main + external services)
# Appends docker-compose.override.yml last if it exists (user overrides, highest precedence)
# IMPORTANT: Requires COMPOSE_PROFILES to be set before calling (via load_env)
# Usage: build_compose_files_array; docker compose "${COMPOSE_FILES[@]}" up -d
# Result is stored in global COMPOSE_FILES array
@@ -369,6 +370,12 @@ build_compose_files_array() {
if path=$(get_dify_compose); then
COMPOSE_FILES+=("-f" "$path")
fi
# Include user overrides last (highest precedence)
local override="$PROJECT_ROOT/docker-compose.override.yml"
if [ -f "$override" ]; then
COMPOSE_FILES+=("-f" "$override")
fi
}
#=============================================================================