forked from github-starred/komodo
implement docker build
This commit is contained in:
@@ -5,8 +5,8 @@ use axum::{
|
||||
Extension, Json, Router,
|
||||
};
|
||||
use helpers::{
|
||||
docker::{self, parse_container_name, DockerClient, DockerExtension},
|
||||
handle_anyhow_error,
|
||||
docker::{self, DockerClient, DockerExtension},
|
||||
handle_anyhow_error, to_monitor_name,
|
||||
};
|
||||
use serde::Deserialize;
|
||||
use types::Deployment;
|
||||
@@ -30,20 +30,20 @@ pub fn router() -> Router {
|
||||
.route(
|
||||
"/start",
|
||||
post(|Json(container): Json<Container>| async move {
|
||||
Json(docker::start_container(&parse_container_name(&container.name)).await)
|
||||
Json(docker::start_container(&to_monitor_name(&container.name)).await)
|
||||
}),
|
||||
)
|
||||
.route(
|
||||
"/stop",
|
||||
post(|Json(container): Json<Container>| async move {
|
||||
Json(docker::stop_container(&parse_container_name(&container.name)).await)
|
||||
Json(docker::stop_container(&to_monitor_name(&container.name)).await)
|
||||
}),
|
||||
)
|
||||
.route(
|
||||
"/remove",
|
||||
post(|Json(container): Json<Container>| async move {
|
||||
Json(
|
||||
docker::stop_and_remove_container(&parse_container_name(&container.name)).await,
|
||||
docker::stop_and_remove_container(&to_monitor_name(&container.name)).await,
|
||||
)
|
||||
}),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user