ShinyProxy Long-Task Container Management: How to Keep Containers Running After Browser Closure Until Computation Completes?

您好,各位技术同仁~
想请教一个关于 ShinyProxy 容器管理的技术问题:

目前我们面临两种应用场景:

短时任务:部分应用运行周期短,希望由 ShinyProxy 完全接管生命周期 —— 当用户关闭浏览器后,自动触发 Docker 容器关闭;(这个没问题shinyproxy做得非常好)
长时任务:另一部分应用计算耗时极长,用户可能在任务完成前关闭浏览器(避免等待),但此时容器需持续运行直至计算结束,完成后再自动关闭。

请问是否有方案可以实现以下需求:

区分任务类型,为长时任务定制「浏览器关闭后保持容器运行」的策略;
待任务计算完成后,自动触发容器关闭流程。

盼各位不吝赐教,感谢!

Hello, fellow technical colleagues~

I’d like to consult a technical issue regarding container management with ShinyProxy.

We currently face two scenarios:

Short-term tasks: Some applications have a short runtime and are fully managed by ShinyProxy for their lifecycle — when users close the browser, the Docker container is automatically triggered to shut down. (This works perfectly with ShinyProxy.)
Long-term tasks: Other applications involve extremely time-consuming computations. Users may close the browser before the task completes (to avoid waiting), but the container needs to keep running until the computation finishes, then shut down automatically.

Could you please advise on implementing the following requirements:

Differentiate between task types and customize a strategy for long-term tasks to “maintain container operation after browser closure”.
Automatically trigger container shutdown after the computation completes.

Thank you.