Files
fn_registry/functions/infra/stop_app.md
T
egutierrez 90693fb32f feat: funciones infra — Docker, deploy, build y health check
Funciones impuras para gestión de contenedores: docker_build_image,
docker_compose_up/down, docker_volume_create/list/remove,
generate_dockerfile, write_dockerfile, go_build_binary, health_check_http,
deploy_app y stop_app. Todas con tests unitarios donde aplica.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 14:24:12 +02:00

1.2 KiB

name, kind, lang, domain, version, purity, signature, description, tags, uses_functions, uses_types, returns, returns_optional, error_type, imports, tested, tests, test_file_path, file_path
name kind lang domain version purity signature description tags uses_functions uses_types returns returns_optional error_type imports tested tests test_file_path file_path
stop_app pipeline go infra 1.0.0 impure func StopApp(containerName string, removeImage bool) error Para y elimina el contenedor de una app desplegada. Si removeImage es true elimina también la imagen Docker. containerName debe coincidir con el imageName usado en deploy_app.
docker
stop
remove
deploy
pipeline
infra
container
docker_stop_container_go_infra
docker_remove_container_go_infra
docker_remove_image_go_infra
false error_go_core
fmt
false
functions/infra/stop_app.go

Ejemplo

// Parar contenedor sin eliminar la imagen (para relanzar rapido)
err := StopApp("myapp", false)

// Parar y limpiar todo
err = StopApp("myapp", true)
if err != nil {
    log.Fatal(err)
}

Notas

Inverso de deploy_app. El contenedor se detiene con 10 segundos de gracia antes de SIGKILL. La imagen se busca como containerName:latest (convencion de deploy_app). Si solo se quiere parar sin limpiar, usar removeImage=false para conservar la imagen en cache local y acelerar el siguiente deploy.