From c2c9d992e77015343f56a99db10dbe816deaea17 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Mon, 15 Aug 2022 09:27:54 +0000 Subject: [PATCH] fix: replace docker compose with docker-compose on CSB --- apps/api/src/lib/common.ts | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/apps/api/src/lib/common.ts b/apps/api/src/lib/common.ts index 369b3f2b5..929aafc08 100644 --- a/apps/api/src/lib/common.ts +++ b/apps/api/src/lib/common.ts @@ -579,6 +579,11 @@ export async function executeDockerCmd({ dockerId, command }: { dockerId: string } else { engine = 'unix:///var/run/docker.sock' } + if (process.env.CODESANDBOX_HOST) { + if (command.startsWith('docker compose')) { + command = command.replace(/docker compose/gi, 'docker-compose') + } + } return await asyncExecShell( `DOCKER_BUILDKIT=1 DOCKER_HOST="${engine}" ${command}` ); @@ -873,11 +878,11 @@ export function generateDatabaseConfiguration(database: any, arch: string): } if (isARM(arch)) { configuration.volume = `${id}-${type}-data:/var/lib/postgresql`; - configuration.environmentVariables = { - POSTGRES_PASSWORD: dbUserPassword, - POSTGRES_USER: dbUser, - POSTGRES_DB: defaultDatabase - } + configuration.environmentVariables = { + POSTGRES_PASSWORD: dbUserPassword, + POSTGRES_USER: dbUser, + POSTGRES_DB: defaultDatabase + } } return configuration } else if (type === 'redis') {