From 6a1301bfc080a4c2f1839fb55b0eac32aa79eba3 Mon Sep 17 00:00:00 2001 From: Yury Kossakovsky Date: Fri, 27 Feb 2026 19:05:50 -0700 Subject: [PATCH] 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 --- CHANGELOG.md | 5 +++++ VERSION | 2 +- scripts/restart.sh | 5 +++++ scripts/utils.sh | 7 +++++++ start_services.py | 10 ++++++++++ 5 files changed, 28 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a50bf3..78d631d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ ## [Unreleased] +## [1.3.2] - 2026-02-27 + +### Fixed +- **Docker Compose** - Respect `docker-compose.override.yml` for user customizations (#44). All compose file assembly points now include the override file when present. + ## [1.3.1] - 2026-02-27 ### Fixed diff --git a/VERSION b/VERSION index 3a3cd8c..1892b92 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.3.1 +1.3.2 diff --git a/scripts/restart.sh b/scripts/restart.sh index d67ae48..dfb3608 100755 --- a/scripts/restart.sh +++ b/scripts/restart.sh @@ -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..." diff --git a/scripts/utils.sh b/scripts/utils.sh index f42f752..40e433c 100755 --- a/scripts/utils.sh +++ b/scripts/utils.sh @@ -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 } #============================================================================= diff --git a/start_services.py b/start_services.py index b88ffa8..5a9ed1c 100755 --- a/start_services.py +++ b/start_services.py @@ -195,6 +195,11 @@ def stop_existing_containers(): if os.path.exists(n8n_workers_compose_path): cmd.extend(["-f", n8n_workers_compose_path]) + # Include user overrides if present + override_path = "docker-compose.override.yml" + if os.path.exists(override_path): + cmd.extend(["-f", override_path]) + cmd.extend(["down"]) run_command(cmd) @@ -230,6 +235,11 @@ def start_local_ai(): if os.path.exists(n8n_workers_compose_path): compose_files.extend(["-f", n8n_workers_compose_path]) + # Include user overrides if present (must be last for highest precedence) + override_path = "docker-compose.override.yml" + if os.path.exists(override_path): + compose_files.extend(["-f", override_path]) + # Explicitly build services and pull newer base images first. print("Checking for newer base images and building services...") build_cmd = ["docker", "compose", "-p", "localai"] + compose_files + ["build", "--pull"]