Skip to content

Commit f1e2467

Browse files
committed
fix/docker-context-path-default: Placeholder with name attribute "dockerContextPath" lied that the default path is ".", while being the Dockerfile directory.
1 parent cabfe2e commit f1e2467

2 files changed

Lines changed: 7 additions & 9 deletions

File tree

‎packages/server/src/utils/builders/docker-file.ts‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,7 @@ export const getDockerCommand = (application: ApplicationNested) => {
2626
try {
2727
const image = `${appName}`;
2828

29-
const defaultContextPath =
30-
dockerFilePath.substring(0, dockerFilePath.lastIndexOf("/") + 1) || ".";
31-
32-
const dockerContextPath =
33-
getDockerContextPath(application) || defaultContextPath;
29+
const dockerContextPath = getDockerContextPath(application);
3430

3531
const commandArgs = ["build", "-t", image, "-f", dockerFilePath, "."];
3632

‎packages/server/src/utils/filesystem/directory.ts‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,10 @@ export const getDockerContextPath = (application: Application) => {
138138
const { APPLICATIONS_PATH } = paths(!!application.serverId);
139139
const { appName, dockerContextPath } = application;
140140

141-
if (!dockerContextPath) {
142-
return null;
143-
}
144-
return path.join(APPLICATIONS_PATH, appName, "code", dockerContextPath);
141+
return path.join(
142+
APPLICATIONS_PATH,
143+
appName,
144+
"code",
145+
dockerContextPath || ".",
146+
);
145147
};

0 commit comments

Comments
 (0)