diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml index 823c8c80e1..b927388a6d 100644 --- a/docker-compose.prod.yml +++ b/docker-compose.prod.yml @@ -1,4 +1,11 @@ services: + # Placeholder for "soketi" overrides in docker-compose.custom.yml from versions before 4.4. + # Realtime runs inside the coolify container now. Without this entry, such an override is an + # incomplete service and every upgrade fails; the inactive profile means it never starts. + soketi: + image: busybox:1.37 + profiles: + - legacy-soketi coolify: image: "${REGISTRY_URL:-docker.io}/coollabsio/coolify:${LATEST_IMAGE:-latest}" volumes: diff --git a/other/nightly/docker-compose.prod.yml b/other/nightly/docker-compose.prod.yml index 823c8c80e1..b927388a6d 100644 --- a/other/nightly/docker-compose.prod.yml +++ b/other/nightly/docker-compose.prod.yml @@ -1,4 +1,11 @@ services: + # Placeholder for "soketi" overrides in docker-compose.custom.yml from versions before 4.4. + # Realtime runs inside the coolify container now. Without this entry, such an override is an + # incomplete service and every upgrade fails; the inactive profile means it never starts. + soketi: + image: busybox:1.37 + profiles: + - legacy-soketi coolify: image: "${REGISTRY_URL:-docker.io}/coollabsio/coolify:${LATEST_IMAGE:-latest}" volumes: diff --git a/tests/Feature/ReverbAndTerminalPackagingTest.php b/tests/Feature/ReverbAndTerminalPackagingTest.php index 194b2e3b45..04a82db3d1 100644 --- a/tests/Feature/ReverbAndTerminalPackagingTest.php +++ b/tests/Feature/ReverbAndTerminalPackagingTest.php @@ -1,8 +1,11 @@ toBeTrue(); expect($composeContents) ->not->toContain('container_name: coolify-realtime') ->not->toContain('coolify-realtime:') - ->not->toContain('soketi:') ->not->toContain('SOKETI_DEFAULT_APP_ID') ->toContain('6001') ->toContain('6002') @@ -304,3 +309,28 @@ it('uses current Reverb and terminal names in development tooling', function () ->toContain('FORWARD_TERMINAL_PORT') ->not->toContain('SOKETI'); }); + +it('accepts a soketi override from 4.3.23 in docker-compose.custom.yml without starting soketi', function (string $composeFile, string $override) { + if (! (new ExecutableFinder)->find('docker')) { + $this->markTestSkipped('Docker is not installed.'); + } + $directory = sys_get_temp_dir().'/coolify-soketi-override-'.Str::random(8); + mkdir($directory); + copy(base_path('docker-compose.yml'), "{$directory}/docker-compose.yml"); + copy(base_path($composeFile), "{$directory}/docker-compose.prod.yml"); + file_put_contents("{$directory}/docker-compose.custom.yml", $override); + + try { + $result = Process::path($directory)->run('docker compose -f docker-compose.yml -f docker-compose.prod.yml -f docker-compose.custom.yml config --services'); + } finally { + File::deleteDirectory($directory); + } + + expect($result->successful())->toBeTrue($result->errorOutput()) + ->and(array_filter(explode("\n", trim($result->output()))))->not->toContain('soketi') + ->toContain('coolify'); +})->with([ + 'production compose, partial override' => ['docker-compose.prod.yml', "services:\n soketi:\n environment:\n SOKETI_DEBUG: 'true'\n ports:\n - '6001:6001'\n"], + 'production compose, full service' => ['docker-compose.prod.yml', "services:\n soketi:\n image: quay.io/soketi/soketi:1.6-16-alpine\n container_name: coolify-realtime\n ports:\n - '6001:6001'\n"], + 'nightly production compose, partial override' => ['other/nightly/docker-compose.prod.yml', "services:\n soketi:\n environment:\n SOKETI_DEBUG: 'true'\n"], +]);