-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't use network_mode: host in docker-compose #50
Comments
@TheAnachronism Thanks for reporting this, really appreciated! I wasn't aware of that as I was just copy-pasting stuff from various places. I'll have a look at it and will improve the example. Alternatively, if you got some spare time, feel free to create a PR with a suggestion. |
Sadly I have no idea how prometheus or grafana work so I don't know which ports are required and how I test if everything actually works... I guess both have at least their default port exposed |
Using `newtork_mode: host` is not a good idea, as pointed out in #50
Prometheus and Grafana need to have one port exposed to make their UIs accessible. In addition to that, Grafana must be able to access Prometheus via HTTP, and Prometheus needs access to all containers (Prometheus scrapes metrics from the other containers, Grafana then queries Prometheus to provide visualizations to the end user). |
Using `newtork_mode: host` is not a good idea, as pointed out in #50. This requires changes to the configs of Prometheus and Grafana, because the containers aren't accessbile via 127.0.0.1 anymore
Found the issue. In the configs for Prometheus and Grafana, I was using #52 looks good to me now. I think that was the solution you have in mind? The confirmation that it works is that http://localhost:9090/targets shows a lot of green badges saying |
Yeah this looks quite good, thx for the quick work and response |
Using `newtork_mode: host` is not a good idea, as pointed out in #50. This requires changes to the configs of Prometheus and Grafana, because the containers aren't accessbile via 127.0.0.1 anymore
The docker-compose example uses network_mode: host multiple times and the different applications want to bind to all kinds of ports then. In an environment that already has many containers running this can produce many conflicts. It would be better if it was setup with docker networks and only had to use host ports which are actually required (e.g. the 8282 port binding for the actual app.)
The text was updated successfully, but these errors were encountered: