Slim Docker runtime image
All checks were successful
Build & Push Docker Image to Gitea Registry / build-and-push (push) Successful in 2m44s

This commit is contained in:
Kroonk
2026-05-20 17:42:52 +02:00
parent c9919479bf
commit e8c1e3539d
3 changed files with 84 additions and 16 deletions

View File

@@ -0,0 +1,33 @@
import { spawn } from "node:child_process";
const processes = [
spawn("node", ["server/dist/server.js"], { stdio: "inherit" }),
spawn("pnpm", ["--filter", "client", "start"], { stdio: "inherit" })
];
let stopping = false;
function stopAll(signal = "SIGTERM") {
stopping = true;
for (const child of processes) {
if (!child.killed) {
child.kill(signal);
}
}
}
for (const signal of ["SIGINT", "SIGTERM"]) {
process.on(signal, () => {
stopAll(signal);
});
}
for (const child of processes) {
child.on("exit", (code, signal) => {
if (stopping) return;
stopping = true;
stopAll();
process.exit(code ?? (signal ? 1 : 0));
});
}