flatline icon indicating copy to clipboard operation
flatline copied to clipboard

Make mysql container not bind to localhost

Open Miosame opened this issue 5 years ago • 2 comments

Currently the scraper is in host networking mode, in the assumption that it can't otherwise access subnets like 192.168.2.0/24 - therefore mysql has to bind to :3306 on host to expose it to the scraper.

The assumption needs to be checked and if the scraper can go without host networking mode to discover outside nodes - make mysql not bind to :3306 and make the scraper connect to mysql-host mysql instead of 127.0.0.1.

Miosame avatar Jan 22 '20 05:01 Miosame

Possibly as a temporary workaround check if 127.0.0.1:3306 is used inside install.sh and then don't bring up another mysql instance.

Miosame avatar Jan 22 '20 06:01 Miosame

Another option could be to just have an option inside .env e.g. EXTERNAL_DATABASE=true which would prevent the docker mysql container from spawning and adjust laravel to be in host mode, in case the user inputs 127.0.0.1 (which does not resolve to the host, if not in network_mode: host)

Miosame avatar Jan 22 '20 06:01 Miosame