Remove container

This commit is contained in:
2025-12-30 13:55:34 +01:00
parent 7dd0dca73c
commit c1eacf996d
7 changed files with 333 additions and 5 deletions
+14
View File
@@ -73,3 +73,17 @@ export async function stopContainer(containerId: string) {
).data
);
}
export async function removeContainer(containerId: string) {
const nodes = await getNodes();
nodes.forEach(
async (n) =>
await (
await axios.delete(`http://${n.ip}:3000/api/container`, {
headers: { Authorization: `ApiKey ${n.key}` },
params: { containerId },
})
).data
);
}
+4
View File
@@ -23,3 +23,7 @@ export async function startContainer(containerId: string) {
export async function stopContainer(containerId: string) {
await docker.getContainer(containerId).stop();
}
export async function removeContainer(containerId: string) {
await docker.getContainer(containerId).remove();
}