Connect docker container to local workbench MySQL DB

*爱你&永不变心* 提交于 2019-11-30 14:36:32
evgenyl

As mentioned on this post, you can try 2 things:

  1. Add gateway and use it from containers, like

docker network create -d bridge --subnet 192.168.0.0/24 --gateway 192.168.0.1 dockernet

  1. In addition to your app container, run proxy (ngnix?) container, which will rout the calls to DB when required

This answer also show how can you obtain the host IP inside the docker container.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!