Connect mastercontainer to docker network specified by APACHE_ADDITIONAL_NETWORK #5539
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.
This is an extension of #5484 to allow for
mastercontainer
's admin page to also be behind a reverse proxy (for security, authentication etc.) instead of just an unsecured localhost port. For example, I've my reverse proxy set up to pointhttps://aio-nextcloud.mydomain.com
tohttps://nextcloud-aio-mastercontainer:8080
for the admin page.Since the user is specifying
APACHE_ADDITIONAL_NETWORK
as a means to connect the reverse proxy, it is natural to use the same information for mastercontainer's reverse proxy setup as well. Yes in theory, the user can create this connection by docker commands or docker compose file (I do this today), but then the user must specify not just the network for proxy but also createnextcloud-aio
doing something like below:This isn't easy or obvious for newcomer, and it'd be much more seamless if handled automatically. FWIW, there's some precedence for mastercontainer manipulating its own network -- the default compose.yml suggests
network_mode: bridge
, then mastercontainer connects itself tonextcloud-aio
and then later disconnects itself from the bridge through a cron job. Since we're manipulating the network, it's a relatively incremental extension to connect mastercontainer with reverse proxy with minimal downsides.And the
start.sh
change also has the nice side-benefit of doing an early error check with clear error message if the specified network has issues.After this change, I imagine the end-user flow to be:
https://aio-nextcloud.mydomain.com
) pointing tohttps://nextcloud-aio-mastercontainer:8080
for the admin page.https://nextcloud.mydomain.com
) pointing tohttp://nextcloud-aio-apache:11000
.APACHE_ADDITIONAL_NETWORK=<the network name of reverse proxy>
.(FWIW, I do intend to post this as a guide somewhere after this pull request goes through.)