Giter Club home page Giter Club logo

Comments (5)

wanghe-fit2cloud avatar wanghe-fit2cloud commented on June 8, 2024 1

收到,我们近期调研一下上述需求的解决方案。

from 1panel.

zhengkunwang223 avatar zhengkunwang223 commented on June 8, 2024

使用 docker exec 【你的 OpenResty 容器名称】 nginx -s reload 也能满足你的需求

from 1panel.

ichenhe avatar ichenhe commented on June 8, 2024

@zhengkunwang223

使用 docker exec 【你的 OpenResty 容器名称】 nginx -s reload 也能满足你的需求

理论上是的。但容器名是会变化的,尽管可以通过 1Panel-openresty- 的前缀查找,但这里的核心点在于「容器名并不是 public api 的一部分」,更像是 hack 做法。目前的确是这么实现的,不过如果能提供稳定的 api 自然更好。毕竟容器是 1panel 启动的,只有 1panel 可以明确知道容器 id。

这里其实引申出了更多问题:目前 1panel 并没有太多考虑外部操作,比如手动修改 nginx vhost 的配置,有可能导致 1panel 解析失败,可视化面板提示 500。更好的做法也许是识别这种情况,然后禁用可视化编辑,再提供一个一键还原的按钮。不过这些超出本 issue 的讨论范围了。

from 1panel.

zhengkunwang223 avatar zhengkunwang223 commented on June 8, 2024

@zhengkunwang223

使用 docker exec 【你的 OpenResty 容器名称】 nginx -s reload 也能满足你的需求

理论上是的。但容器名是会变化的,尽管可以通过 1Panel-openresty- 的前缀查找,但这里的核心点在于「容器名并不是 public api 的一部分」,更像是 hack 做法。目前的确是这么实现的,不过如果能提供稳定的 api 自然更好。毕竟容器是 1panel 启动的,只有 1panel 可以明确知道容器 id。

如果你不手动修改容器名,容器名是不会改变的,如果你想多个主机都用一样的容器名,你可以在安装的时候指定容器名称都为openresty,已安装的可以在参数-编辑-高级设置中修改,这样你就可以有统一的脚本。顺道说一句,我们也没有记录容器 id ,我们只记录了容器名称,应用状态也是根据容器名称获取的。

from 1panel.

ichenhe avatar ichenhe commented on June 8, 2024

如果你不手动修改容器名,容器名是不会改变的,如果你想多个主机都用一样的容器名,你可以在安装的时候指定容器名称都为openresty,已安装的可以在参数-编辑-高级设置中修改,这样你就可以有统一的脚本。顺道说一句,我们也没有记录容器 id ,我们只记录了容器名称,应用状态也是根据容器名称获取的。

了解,感谢解释。这么看的话的确可以自己与容器交互。

from 1panel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.