From c0694eb5b2e32280c2b4709a800b273042941c0f Mon Sep 17 00:00:00 2001 From: Mauricio Siu Date: Sat, 8 Aug 2026 23:36:48 -0600 Subject: [PATCH] fix: improve mount path warning for PostgreSQL by handling multiple data mounts --- .../postgres/advanced/show-custom-command.tsx | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/apps/dokploy/components/dashboard/postgres/advanced/show-custom-command.tsx b/apps/dokploy/components/dashboard/postgres/advanced/show-custom-command.tsx index 5a1a7753d..4023230f8 100644 --- a/apps/dokploy/components/dashboard/postgres/advanced/show-custom-command.tsx +++ b/apps/dokploy/components/dashboard/postgres/advanced/show-custom-command.tsx @@ -109,16 +109,21 @@ export const ShowCustomCommand = ({ id, type }: Props) => { const mountPathWarning = (() => { if (type !== "postgres" || !dockerImage) return null; - const mounts = (data as any)?.mounts ?? []; - const dataMount = mounts.find( - (mount: { type: string; mountPath: string }) => + const mounts = data && "mounts" in data ? data.mounts : []; + const dataMounts = mounts.filter( + (mount) => mount.type === "volume" && POSTGRES_DATA_PATH_REGEX.test(mount.mountPath), ); - if (!dataMount) return null; + if (dataMounts.length === 0) return null; const expectedPath = getPostgresMountPath(dockerImage); - if (expectedPath === dataMount.mountPath) return null; - return { expectedPath, currentPath: dataMount.mountPath }; + if (dataMounts.some((mount) => mount.mountPath === expectedPath)) { + return null; + } + return { + expectedPath, + currentPath: dataMounts.map((mount) => mount.mountPath).join(", "), + }; })(); const onSubmit = async (formData: AddDockerImage) => {