我如何将 network_mode: host 容器连接到其数据库容器
我设置了我的 FreePBX 使用 network_mode: 'host',但在无法连接到不使用 network_mode: 'host' 的 MariaDB 容器时遇到了问题。
我通过以下方式修复了此问题:
- 将 MariaDB 容器设置为
network_mode: 'host' - 将 FreePBX 容器设置为连接到
127.0.0.1(DB_HOST=127.0.0.1)。将其设置为localhost不允许 FreePBX 连接到 MariaDB!
Check out similar posts by category:
Docker, FreePBX, Networking
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow