From a956e11b3e408a9b5c8b9843525fd069a01712f0 Mon Sep 17 00:00:00 2001 From: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com> Date: Wed, 22 Oct 2025 17:09:36 +0200 Subject: [PATCH] Fix: Remove content from docker_compose_raw to prevent file overwrites MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When users define volumes with content: in compose files, the content was being removed from docker_compose but not docker_compose_raw. This caused files to be overwritten on every deployment/save when users edited the compose file. Now both docker_compose and docker_compose_raw are updated with the cleaned version (without content:), allowing users to freely edit files in the persistent storage view without them being overwritten. The content: field now acts as an initial value only - it creates the file on first deployment, then is removed so users have full control over file contents. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- bootstrap/helpers/parsers.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/bootstrap/helpers/parsers.php b/bootstrap/helpers/parsers.php index f2260f0c6..84d2e03b2 100644 --- a/bootstrap/helpers/parsers.php +++ b/bootstrap/helpers/parsers.php @@ -1297,7 +1297,11 @@ function applicationParser(Application $resource, int $pull_request_id = 0, ?int return array_search($key, $customOrder); }); - $resource->docker_compose = Yaml::dump(convertToArray($topLevel), 10, 2); + $cleanedCompose = Yaml::dump(convertToArray($topLevel), 10, 2); + $resource->docker_compose = $cleanedCompose; + // Also update docker_compose_raw to remove content: from volumes + // This prevents content from being reapplied on subsequent deployments + $resource->docker_compose_raw = $cleanedCompose; data_forget($resource, 'environment_variables'); data_forget($resource, 'environment_variables_preview'); $resource->save(); @@ -2220,7 +2224,11 @@ function serviceParser(Service $resource): Collection return array_search($key, $customOrder); }); - $resource->docker_compose = Yaml::dump(convertToArray($topLevel), 10, 2); + $cleanedCompose = Yaml::dump(convertToArray($topLevel), 10, 2); + $resource->docker_compose = $cleanedCompose; + // Also update docker_compose_raw to remove content: from volumes + // This prevents content from being reapplied on subsequent deployments + $resource->docker_compose_raw = $cleanedCompose; data_forget($resource, 'environment_variables'); data_forget($resource, 'environment_variables_preview'); $resource->save();