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

@@ -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

View File

@@ -1 +1 @@
1.3.1
1.3.2

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
}
#=============================================================================

View File

@@ -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"]