Load Vault before backend migrations
All checks were successful
Build and deploy Backend / build (push) Successful in 1m12s

This commit is contained in:
Ruslan Bakiev
2026-05-08 17:16:08 +07:00
parent 203d37f3c7
commit 359a4237c3
2 changed files with 27 additions and 1 deletions

26
src/entrypoint.ts Normal file
View File

@@ -0,0 +1,26 @@
import { spawn } from 'node:child_process';
import { loadVaultEnvironment } from './vault/env.js';
function run(command: string, args: string[]): Promise<void> {
return new Promise((resolve, reject) => {
const child = spawn(command, args, {
env: process.env,
stdio: 'inherit',
});
child.on('error', reject);
child.on('exit', (code) => {
if (code === 0) {
resolve();
return;
}
reject(new Error(`${command} ${args.join(' ')} exited with ${code}`));
});
});
}
await loadVaultEnvironment();
await run('npm', ['run', 'prisma:migrate:deploy']);
await import('./server.js');