From f6381b61938436808ce971610b93169187ba62e7 Mon Sep 17 00:00:00 2001 From: Alimedhat000 Date: Fri, 29 May 2026 08:29:34 +0300 Subject: [PATCH] fix: use --env instead of --env-file in nixpacks build strat --- .../worker/src/deployments/strategies/nixpacks.ts | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/packages/worker/src/deployments/strategies/nixpacks.ts b/packages/worker/src/deployments/strategies/nixpacks.ts index 344bc37..868c7b5 100644 --- a/packages/worker/src/deployments/strategies/nixpacks.ts +++ b/packages/worker/src/deployments/strategies/nixpacks.ts @@ -60,13 +60,11 @@ function runNixpacksBuild( args.push("--start-cmd", app.runCommand); } - // Write env vars to a temporary file so secrets never appear on the command line. - const envFilePath = path.join(workspacePath, ".env"); - const envFileContent = Object.entries(envMap) - .map(([k, v]) => `${k}="${v.replace(/"/g, '\\"')}"`) - .join("\n"); - fs.writeFileSync(envFilePath, envFileContent, { mode: 0o600 }); - args.push("--env-file", envFilePath); + // Pass env vars individually. In a container env, command-line + // args are not visible to other processes. + for (const [k, v] of Object.entries(envMap)) { + args.push("--env", `${k}=${v}`); + } const proc = spawn("nixpacks", args, { cwd: repoDir,