Stop using network_mode: host for nginx and haproxy #369
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Using host network reduces separation and potentially exposes more ports publicly than needed or intended. In some cases (such as opening up many dynamic ports) this is needed, but for haproxy and nginx this is not the case. Haproxy only needs port 80 and 443 externally, and nginx normally does not need to expose anything external (only to another reverse proxy such as haproxy).
With some care, these containers can be changed to use regular networking instead (which is what this PR does).
See the commit messages for details.
Issue #138 also talks about a change like this and suggests that it would not be possible. If I read that issue correctly (but it is vague and only implies the issue), it might suggest that it would not work because freeswitch would need ipv6 connections to be forwarded over ipv6, which is what the nginx example in https://github.com/bigbluebutton/docker/blob/develop/docs/existing-web-server.md does. However:
There is also a bit of development config (here and here. I've updated this as far as I understand how it works, but I'm not 100% sure (and have not been able to test this, since I was running on a remote server, not locally).