Start/stop deployments

This commit is contained in:
2026-02-14 14:09:58 +01:00
parent 2e8525123d
commit 8f320747ad
4 changed files with 94 additions and 12 deletions
+17
View File
@@ -164,3 +164,20 @@ export async function deployApp(
fs.rmSync(deployPath, { recursive: true, force: true });
}
}
export async function toggleDeployment(
containerId: string,
action: "start" | "stop",
) {
const container = docker.getContainer(containerId);
try {
if (action === "start") {
await container.start();
} else {
await container.stop();
}
} catch (err) {
console.error(`Failed to ${action} container ${containerId}:`, err);
}
}