From dd313cf8c8d642b1da7740fbdc459635b18be3e0 Mon Sep 17 00:00:00 2001 From: Bryan1029384756 <23323626+Bryan1029384756@users.noreply.github.com> Date: Sat, 21 Feb 2026 16:13:10 -0600 Subject: [PATCH] docker fix --- deploy/server/server.js | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/deploy/server/server.js b/deploy/server/server.js index 594b6cb..3ee77aa 100644 --- a/deploy/server/server.js +++ b/deploy/server/server.js @@ -1,10 +1,13 @@ import express from 'express'; import compression from 'compression'; -import { execSync } from 'child_process'; +import { exec } from 'child_process'; +import { promisify } from 'util'; import { existsSync, mkdirSync, cpSync, rmSync, readdirSync, readFileSync } from 'fs'; import { join, dirname } from 'path'; import { fileURLToPath } from 'url'; +const execAsync = promisify(exec); + const __dirname = dirname(fileURLToPath(import.meta.url)); const PORT = process.env.PORT || 3000; @@ -35,9 +38,11 @@ function findLatestRelease() { return null; } -function run(cmd, opts = {}) { +async function run(cmd, opts = {}) { log(`> ${cmd}`); - execSync(cmd, { stdio: 'inherit', timeout: 600_000, ...opts }); + const { stdout, stderr } = await execAsync(cmd, { timeout: 600_000, maxBuffer: 50 * 1024 * 1024, ...opts }); + if (stdout) process.stdout.write(stdout); + if (stderr) process.stderr.write(stderr); } async function triggerBuild(webhookCommit) { @@ -60,10 +65,11 @@ async function triggerBuild(webhookCommit) { log('Starting build...'); // Clone - run(`git clone --depth 1 --branch ${GIT_BRANCH} ${GIT_REPO_URL} ${buildDir}`); + await run(`git clone --depth 1 --branch ${GIT_BRANCH} ${GIT_REPO_URL} ${buildDir}`); // Read the cloned commit hash - const clonedHash = execSync('git rev-parse HEAD', { cwd: buildDir, encoding: 'utf-8' }).trim(); + const { stdout: hashOut } = await execAsync('git rev-parse HEAD', { cwd: buildDir }); + const clonedHash = hashOut.trim(); log(`Cloned commit: ${clonedHash}`); // Skip if this commit is already deployed @@ -74,14 +80,14 @@ async function triggerBuild(webhookCommit) { } // Install deps (web workspaces only) - run( + await run( 'npm ci --workspace=apps/web --workspace=packages/shared --workspace=packages/platform-web --include-workspace-root', { cwd: buildDir } ); // Build const env = { ...process.env, VITE_CONVEX_URL, VITE_LIVEKIT_URL }; - run('npm run build:web', { cwd: buildDir, env }); + await run('npm run build:web', { cwd: buildDir, env }); // Copy dist to release dir const distDir = join(buildDir, 'apps', 'web', 'dist');