mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
fix(builder): fixed docker-compose issue
This commit is contained in:
parent
94786c738b
commit
cb02deb837
@ -198,32 +198,32 @@ export const processComposeFile = (compose: ComposeNested) => {
|
|||||||
const { COMPOSE_PATH } = paths();
|
const { COMPOSE_PATH } = paths();
|
||||||
const { env, appName, sourceType, composeType } = compose;
|
const { env, appName, sourceType, composeType } = compose;
|
||||||
|
|
||||||
|
const inputPath =
|
||||||
|
sourceType === "raw" ? "docker-compose.yml" : compose.composePath;
|
||||||
|
const composeInputFilePath =
|
||||||
|
join(COMPOSE_PATH, appName, "code", inputPath) ||
|
||||||
|
join(COMPOSE_PATH, appName, "code", "docker-compose.yml");
|
||||||
|
|
||||||
|
const outputPath = "docker-compose.processed.yml";
|
||||||
|
const composeOutputFilePath =
|
||||||
|
join(COMPOSE_PATH, appName, "code", outputPath) ||
|
||||||
|
join(COMPOSE_PATH, appName, "code", "docker-compose.processed.yml");
|
||||||
|
|
||||||
|
let templateContent = readFileSync(composeInputFilePath, "utf8");
|
||||||
|
|
||||||
if (composeType === "stack") {
|
if (composeType === "stack") {
|
||||||
const inputPath =
|
|
||||||
sourceType === "raw" ? "docker-compose.yml" : compose.composePath;
|
|
||||||
const composeInputFilePath =
|
|
||||||
join(COMPOSE_PATH, appName, "code", inputPath) ||
|
|
||||||
join(COMPOSE_PATH, appName, "code", "docker-compose.yml");
|
|
||||||
|
|
||||||
const outputPath = "docker-compose.processed.yml";
|
|
||||||
const composeOutputFilePath =
|
|
||||||
join(COMPOSE_PATH, appName, "code", outputPath) ||
|
|
||||||
join(COMPOSE_PATH, appName, "code", "docker-compose.processed.yml");
|
|
||||||
|
|
||||||
const envContent = prepareEnvironmentVariables(env || "").join("\n");
|
const envContent = prepareEnvironmentVariables(env || "").join("\n");
|
||||||
const envVariables = dotenv.parse(envContent);
|
const envVariables = dotenv.parse(envContent);
|
||||||
|
|
||||||
let templateContent = readFileSync(composeInputFilePath, "utf8");
|
|
||||||
|
|
||||||
templateContent = templateContent.replace(
|
templateContent = templateContent.replace(
|
||||||
/\$\{([^}]+)\}/g,
|
/\$\{([^}]+)\}/g,
|
||||||
(_, varName) => {
|
(_, varName) => {
|
||||||
return envVariables[varName] || "";
|
return envVariables[varName] || "";
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
writeFileSync(composeOutputFilePath, templateContent);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
writeFileSync(composeOutputFilePath, templateContent);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getProcessComposeFileCommand = (compose: ComposeNested) => {
|
export const getProcessComposeFileCommand = (compose: ComposeNested) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user