diff --git a/internal/handlers/api.go b/internal/handlers/api.go index 6667906..b85c286 100644 --- a/internal/handlers/api.go +++ b/internal/handlers/api.go @@ -270,6 +270,9 @@ func (h *Handlers) HandleAPIDeleteApp() http.HandlerFunc { return } + // Stop and remove the Docker container before deleting the DB record + h.cleanupContainer(request.Context(), appID, application.Name) + deleteErr := h.appService.DeleteApp(request.Context(), application) if deleteErr != nil { h.log.Error("api: failed to delete app", "error", deleteErr)