diff --git a/apps/dokploy/__test__/templates/config.template.test.ts b/apps/dokploy/__test__/templates/config.template.test.ts index 202abdf2d..52be798d7 100644 --- a/apps/dokploy/__test__/templates/config.template.test.ts +++ b/apps/dokploy/__test__/templates/config.template.test.ts @@ -494,4 +494,49 @@ describe("processTemplate", () => { expect(result.mounts).toHaveLength(1); }); }); + + describe("isolated deployment config", () => { + it("should default to isolated=true when not specified", () => { + const template: CompleteTemplate = { + metadata: {} as any, + variables: {}, + config: { + domains: [], + env: {}, + }, + }; + + expect(template.config.isolated).toBeUndefined(); + // undefined !== false => isolatedDeployment = true + expect(template.config.isolated !== false).toBe(true); + }); + + it("should be isolated when isolated=true is explicitly set", () => { + const template: CompleteTemplate = { + metadata: {} as any, + variables: {}, + config: { + isolated: true, + domains: [], + env: {}, + }, + }; + + expect(template.config.isolated !== false).toBe(true); + }); + + it("should disable isolated deployment when isolated=false", () => { + const template: CompleteTemplate = { + metadata: {} as any, + variables: {}, + config: { + isolated: false, + domains: [], + env: {}, + }, + }; + + expect(template.config.isolated !== false).toBe(false); + }); + }); }); diff --git a/apps/dokploy/__test__/templates/helpers.template.test.ts b/apps/dokploy/__test__/templates/helpers.template.test.ts index f2af2717b..e95bbf072 100644 --- a/apps/dokploy/__test__/templates/helpers.template.test.ts +++ b/apps/dokploy/__test__/templates/helpers.template.test.ts @@ -30,9 +30,7 @@ describe("helpers functions", () => { const domain = processValue("${domain}", {}, mockSchema); expect(domain.startsWith(`${mockSchema.projectName}-`)).toBeTruthy(); expect( - domain.endsWith( - `${mockSchema.serverIp.replaceAll(".", "-")}.traefik.me`, - ), + domain.endsWith(`${mockSchema.serverIp.replaceAll(".", "-")}.sslip.io`), ).toBeTruthy(); }); }); diff --git a/apps/dokploy/server/api/routers/compose.ts b/apps/dokploy/server/api/routers/compose.ts index 0398b6ba9..254818478 100644 --- a/apps/dokploy/server/api/routers/compose.ts +++ b/apps/dokploy/server/api/routers/compose.ts @@ -640,7 +640,7 @@ export const composeRouter = createTRPCRouter({ name: input.id, sourceType: "raw", appName: appName, - isolatedDeployment: true, + isolatedDeployment: template.config.config?.isolated !== false, }); await addNewService(ctx, compose.composeId); diff --git a/packages/server/src/templates/github.ts b/packages/server/src/templates/github.ts index da697d80c..5b5c4ade8 100644 --- a/packages/server/src/templates/github.ts +++ b/packages/server/src/templates/github.ts @@ -21,6 +21,7 @@ export interface CompleteTemplate { [key: string]: string; }; config: { + isolated?: boolean; domains: Array<{ serviceName: string; port: number; diff --git a/packages/server/src/templates/processors.ts b/packages/server/src/templates/processors.ts index ce1553095..bd170e104 100644 --- a/packages/server/src/templates/processors.ts +++ b/packages/server/src/templates/processors.ts @@ -45,6 +45,7 @@ export interface CompleteTemplate { }; variables: Record; config: { + isolated?: boolean; domains: DomainConfig[]; env: | Record