fix(api): skip domain generation for Docker Compose applications

This commit is contained in:
Andras Bacsai
2026-10-05 15:09:25 +02:00
parent 35c38b1dde
commit 01ea05959e
3 changed files with 33 additions and 6 deletions
@@ -266,6 +266,26 @@ test('API create accepts a safe docker_compose_raw', function () {
->assertCreated();
});
test('API create does not generate a domain for a docker compose application', function () {
Queue::fake();
$response = $this->withHeaders(['Authorization' => 'Bearer '.$this->token])
->postJson('/api/v1/applications/public', [
'project_uuid' => $this->project->uuid,
'environment_uuid' => $this->environment->uuid,
'server_uuid' => $this->server->uuid,
'git_repository' => 'https://gitlab.com/coolify/compose-app',
'git_branch' => 'main',
'build_pack' => 'dockercompose',
'ports_exposes' => '80',
'autogenerate_domain' => true,
'docker_compose_raw' => SAFE_APPLICATION_COMPOSE,
])
->assertCreated();
expect(Application::query()->where('uuid', $response->json('uuid'))->value('fqdn'))->toBeNull();
});
test('API update does not accept docker_compose_raw', function () {
$this->withHeaders(['Authorization' => 'Bearer '.$this->token])
->patchJson("/api/v1/applications/{$this->application->uuid}", [
@@ -86,3 +86,9 @@ test('public github repositories are stored as owner and repository with the pub
->and($application->source_type)->toBe(GithubApp::class)
->and($application->source_id)->toBe(0);
});
test('a public application gets a generated domain by default', function () {
$application = createPublicGitApplication(['autogenerate_domain' => true]);
expect($application->fqdn)->not->toBeEmpty();
});