From ac26bb95e38c836b495315c3246125d14915f5e0 Mon Sep 17 00:00:00 2001 From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> Date: Fri, 2 Aug 2024 13:40:25 -0600 Subject: [PATCH 1/3] fix(template): add missing file path --- .../advanced/volumes/add-volumes.tsx | 30 +++++++++---------- apps/dokploy/server/api/routers/compose.ts | 1 + apps/dokploy/templates/utils/index.ts | 1 + 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/apps/dokploy/components/dashboard/application/advanced/volumes/add-volumes.tsx b/apps/dokploy/components/dashboard/application/advanced/volumes/add-volumes.tsx index e32ad756..3e219295 100644 --- a/apps/dokploy/components/dashboard/application/advanced/volumes/add-volumes.tsx +++ b/apps/dokploy/components/dashboard/application/advanced/volumes/add-volumes.tsx @@ -82,7 +82,7 @@ export const AddVolumes = ({ defaultValues: { type: serviceType === "compose" ? "file" : "bind", hostPath: "", - mountPath: serviceType === "compose" ? "/" : "", + mountPath: "", }, resolver: zodResolver(mySchema), }); @@ -330,22 +330,20 @@ export const AddVolumes = ({ /> )} - {serviceType !== "compose" && ( - ( - - Mount Path (In the container) - - - + ( + + Mount Path (In the container) + + + - - - )} - /> - )} + + + )} + /> diff --git a/apps/dokploy/server/api/routers/compose.ts b/apps/dokploy/server/api/routers/compose.ts index f97fac37..f1bbeb2a 100644 --- a/apps/dokploy/server/api/routers/compose.ts +++ b/apps/dokploy/server/api/routers/compose.ts @@ -227,6 +227,7 @@ export const composeRouter = createTRPCRouter({ if (mounts && mounts?.length > 0) { for (const mount of mounts) { await createMount({ + filePath: mount.filePath, mountPath: mount.mountPath, content: mount.content, serviceId: compose.composeId, diff --git a/apps/dokploy/templates/utils/index.ts b/apps/dokploy/templates/utils/index.ts index 03ab71a4..fe87e1a8 100644 --- a/apps/dokploy/templates/utils/index.ts +++ b/apps/dokploy/templates/utils/index.ts @@ -13,6 +13,7 @@ export interface Schema { export interface Template { envs: string[]; mounts?: { + filePath: string; mountPath: string; content?: string; }[]; From 95899b72085c4025c48b0caaeaef2193cfe3d79f Mon Sep 17 00:00:00 2001 From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> Date: Fri, 2 Aug 2024 13:45:20 -0600 Subject: [PATCH 2/3] fix(templates): update path file path --- apps/dokploy/templates/plausible/index.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/dokploy/templates/plausible/index.ts b/apps/dokploy/templates/plausible/index.ts index 95cfd4ed..3c106a8e 100644 --- a/apps/dokploy/templates/plausible/index.ts +++ b/apps/dokploy/templates/plausible/index.ts @@ -23,6 +23,7 @@ export function generate(schema: Schema): Template { const mounts: Template["mounts"] = [ { + filePath: "clickhouse-config.xml", mountPath: "./clickhouse/clickhouse-config.xml", content: ` @@ -45,6 +46,7 @@ export function generate(schema: Schema): Template { `, }, { + filePath: "clickhouse-user-config.xml", mountPath: "./clickhouse/clickhouse-user-config.xml", content: ` From 4bd6ec22321687e7977b93015ed08a3f12866e8c Mon Sep 17 00:00:00 2001 From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> Date: Sat, 3 Aug 2024 14:59:20 -0600 Subject: [PATCH 3/3] fix(templates): use filePath instead of mountPath --- .../advanced/volumes/add-volumes.tsx | 30 ++++++++++--------- apps/dokploy/server/api/routers/compose.ts | 2 +- apps/dokploy/templates/listmonk/index.ts | 2 +- apps/dokploy/templates/plausible/index.ts | 6 ++-- apps/dokploy/templates/utils/index.ts | 1 - 5 files changed, 20 insertions(+), 21 deletions(-) diff --git a/apps/dokploy/components/dashboard/application/advanced/volumes/add-volumes.tsx b/apps/dokploy/components/dashboard/application/advanced/volumes/add-volumes.tsx index 3e219295..e32ad756 100644 --- a/apps/dokploy/components/dashboard/application/advanced/volumes/add-volumes.tsx +++ b/apps/dokploy/components/dashboard/application/advanced/volumes/add-volumes.tsx @@ -82,7 +82,7 @@ export const AddVolumes = ({ defaultValues: { type: serviceType === "compose" ? "file" : "bind", hostPath: "", - mountPath: "", + mountPath: serviceType === "compose" ? "/" : "", }, resolver: zodResolver(mySchema), }); @@ -330,20 +330,22 @@ export const AddVolumes = ({ /> )} - ( - - Mount Path (In the container) - - - + {serviceType !== "compose" && ( + ( + + Mount Path (In the container) + + + - - - )} - /> + + + )} + /> + )} diff --git a/apps/dokploy/server/api/routers/compose.ts b/apps/dokploy/server/api/routers/compose.ts index f1bbeb2a..3b8a92f6 100644 --- a/apps/dokploy/server/api/routers/compose.ts +++ b/apps/dokploy/server/api/routers/compose.ts @@ -228,7 +228,7 @@ export const composeRouter = createTRPCRouter({ for (const mount of mounts) { await createMount({ filePath: mount.filePath, - mountPath: mount.mountPath, + mountPath: "", content: mount.content, serviceId: compose.composeId, serviceType: "compose", diff --git a/apps/dokploy/templates/listmonk/index.ts b/apps/dokploy/templates/listmonk/index.ts index 8dbea12e..d56d783d 100644 --- a/apps/dokploy/templates/listmonk/index.ts +++ b/apps/dokploy/templates/listmonk/index.ts @@ -21,7 +21,7 @@ export function generate(schema: Schema): Template { const mounts: Template["mounts"] = [ { - mountPath: "./config.toml", + filePath: "config.toml", content: `[app] address = "0.0.0.0:9000" diff --git a/apps/dokploy/templates/plausible/index.ts b/apps/dokploy/templates/plausible/index.ts index 3c106a8e..643c5df0 100644 --- a/apps/dokploy/templates/plausible/index.ts +++ b/apps/dokploy/templates/plausible/index.ts @@ -23,8 +23,7 @@ export function generate(schema: Schema): Template { const mounts: Template["mounts"] = [ { - filePath: "clickhouse-config.xml", - mountPath: "./clickhouse/clickhouse-config.xml", + filePath: "/clickhouse/clickhouse-config.xml", content: ` @@ -46,8 +45,7 @@ export function generate(schema: Schema): Template { `, }, { - filePath: "clickhouse-user-config.xml", - mountPath: "./clickhouse/clickhouse-user-config.xml", + filePath: "/clickhouse/clickhouse-user-config.xml", content: ` diff --git a/apps/dokploy/templates/utils/index.ts b/apps/dokploy/templates/utils/index.ts index fe87e1a8..4d194ba9 100644 --- a/apps/dokploy/templates/utils/index.ts +++ b/apps/dokploy/templates/utils/index.ts @@ -14,7 +14,6 @@ export interface Template { envs: string[]; mounts?: { filePath: string; - mountPath: string; content?: string; }[]; }