From 814b61bd2cf18772d03207727c0f22628561616b Mon Sep 17 00:00:00 2001 From: Wildan M Date: Wed, 18 Sep 2024 08:21:22 +0700 Subject: [PATCH] Retain everything else in composer --- src/executor/docker.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/executor/docker.js b/src/executor/docker.js index 1bdf888..5072d2f 100644 --- a/src/executor/docker.js +++ b/src/executor/docker.js @@ -143,19 +143,22 @@ class DockerExecutor { */ async executeServices(services, home, domain) { let filename = path.join(home, 'docker-compose.yml'); + let composeObject = {}; if (typeof services === 'string') { filename = path.join(home, services); // cat from file - services = yaml.parse(await executeLock('compose', () => { + composeObject = yaml.parse(await executeLock('compose', () => { return new Promise((resolve, reject) => { spawnSudoUtil('COMPOSE_GET', [filename]).then(() => { resolve(cat(tmpFile)); }).catch(reject); }); - })).services; + })); + } else { + composeObject.services = services; } - services = this.rewriteServices(services, domain); - let composeFile = yaml.stringify({ services }); + composeObject.services = this.rewriteServices(composeObject.services, domain); + let composeFile = yaml.stringify(composeObject); await executeLock('compose', () => { return new Promise((resolve, reject) => { ShellString(composeFile).to(filename)