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] 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 3e2192959..e32ad7560 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 f1bbeb2ad..3b8a92f63 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 8dbea12e7..d56d783df 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 3c106a8e0..643c5df05 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 fe87e1a8b..4d194ba94 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; }[]; }