diff --git a/packages/server/src/utils/builders/docker-file.ts b/packages/server/src/utils/builders/docker-file.ts index 5f315cd58..b02156ee8 100644 --- a/packages/server/src/utils/builders/docker-file.ts +++ b/packages/server/src/utils/builders/docker-file.ts @@ -26,11 +26,7 @@ export const getDockerCommand = (application: ApplicationNested) => { try { const image = `${appName}`; - const defaultContextPath = - dockerFilePath.substring(0, dockerFilePath.lastIndexOf("/") + 1) || "."; - - const dockerContextPath = - getDockerContextPath(application) || defaultContextPath; + const dockerContextPath = getDockerContextPath(application); const commandArgs = ["build", "-t", image, "-f", dockerFilePath, "."]; diff --git a/packages/server/src/utils/filesystem/directory.ts b/packages/server/src/utils/filesystem/directory.ts index 3713ef575..c5e354ac8 100644 --- a/packages/server/src/utils/filesystem/directory.ts +++ b/packages/server/src/utils/filesystem/directory.ts @@ -138,8 +138,10 @@ export const getDockerContextPath = (application: Application) => { const { APPLICATIONS_PATH } = paths(!!application.serverId); const { appName, dockerContextPath } = application; - if (!dockerContextPath) { - return null; - } - return path.join(APPLICATIONS_PATH, appName, "code", dockerContextPath); + return path.join( + APPLICATIONS_PATH, + appName, + "code", + dockerContextPath || ".", + ); };