refactor(docker): remove unused environment file command generation and simplify Docker command construction

This commit is contained in:
Mauricio Siu
2025-12-06 19:06:53 -06:00
parent 4210eefd37
commit dbc1396fa6

View File

@@ -8,7 +8,6 @@ import {
getDockerContextPath,
} from "../filesystem/directory";
import type { ApplicationNested } from ".";
import { createEnvFileCommand } from "./utils";
export const getDockerCommand = (application: ApplicationNested) => {
const {
@@ -68,21 +67,7 @@ export const getDockerCommand = (application: ApplicationNested) => {
commandArgs.push("--secret", `type=env,id=${key}`);
}
/*
Do not generate an environment file when publishDirectory is specified,
as it could be publicly exposed.
*/
let command = "";
if (!publishDirectory) {
command += createEnvFileCommand(
dockerFilePath,
env,
application.environment.project.env,
application.environment.env,
);
}
command += `
const command = `
echo "Building ${appName}" ;
cd ${dockerContextPath} || {
echo "❌ The path ${dockerContextPath} does not exist" ;