Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Simon L. <[email protected]>
Signed-off-by: Apoorv Parle <[email protected]>
  • Loading branch information
apparle and szaimen authored Nov 4, 2024
1 parent 4ad749a commit 75c2407
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions php/src/Docker/DockerActionManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -850,7 +850,7 @@ private function ConnectContainerIdToNetwork(string $id, string $internalPort, s
return;
}

if($createNetwork) {
if ($createNetwork) {
$url = $this->BuildApiUrl('networks/create');
try {
$this->guzzleClient->request(
Expand All @@ -876,17 +876,17 @@ private function ConnectContainerIdToNetwork(string $id, string $internalPort, s
$url = $this->BuildApiUrl(
sprintf('networks/%s/connect', $network)
);
$json_payload = [ 'Container' => $id ];
$jsonPayload = [ 'Container' => $id ];
if ($alias !== '' ) {
$json_payload['EndpointConfig'] = [ 'Aliases' => [ $alias ] ];
$jsonPayload['EndpointConfig'] = ['Aliases' => [ $alias ]];
}

try {
$this->guzzleClient->request(
'POST',
$url,
[
'json' => $json_payload
'json' => $jsonPayload
]
);
} catch (RequestException $e) {
Expand Down Expand Up @@ -921,7 +921,7 @@ public function ConnectContainerToNetwork(Container $container) : void
if ($container->GetIdentifier() === 'nextcloud-aio-apache' || $container->GetIdentifier() === 'nextcloud-aio-domaincheck') {
$apacheAdditionalNetwork = $this->configurationManager->GetApacheAdditionalNetwork();
if ($apacheAdditionalNetwork !== '') {
$this->ConnectContainerIdToNetwork($container->GetIdentifier(), $container->GetInternalPort(), $apacheAdditionalNetwork, false, alias: $alias);
$this->ConnectContainerIdToNetwork($container->GetIdentifier(), $container->GetInternalPort(), $apacheAdditionalNetwork, false, $alias);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion reverse-proxy.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ All examples below will use port `11000` as `APACHE_PORT`. This port will be exp

The reverse-proxy container needs to be connected to the nextcloud containers. This can be achieved one of these 3 ways:
1. Utilize host networking instead of docker bridge networking: Specify `--network host` option (or `network_mode: host` for docker-compose) as setting for the reverse proxy container to connect it to the host network. If you are using a firewall on the server, you need to open ports 80 and 443 for the reverse proxy manually. With this setup, the default sample configurations with reverse-proxy pointing to `localhost:$APACHE_PORT` should work directly.
1. Connect nextcloud's external-facing containers to the reverse-proxy's docker network by specifying env variable APACHE_ADDITIONAL_NETWORK. With this setup, the reverse proxy can utilize Docker bridge network's DNS name resolution to access nextcloud at `http://nextcloud-aio-apache:$APACHE_PORT`. Note, the specified network must already exist before Nextcloud AIO is started.
1. Connect nextcloud's external-facing containers to the reverse-proxy's docker network by specifying env variable APACHE_ADDITIONAL_NETWORK. With this setup, the reverse proxy can utilize Docker bridge network's DNS name resolution to access nextcloud at `http://nextcloud-aio-apache:$APACHE_PORT`. ⚠️⚠️⚠️ Note, the specified network must already exist before Nextcloud AIO is started. Otherwise it will fail to start the container because the network is not existing.
1. Connect the reverse-proxy container to the `nextcloud-aio` network by specifying it as a secondary (external) network for the reverse proxy container. With this setup also, the reverse proxy can utilize Docker bridge network's DNS name resolution to access nextcloud at `http://nextcloud-aio-apache:$APACHE_PORT` .

</details>
Expand Down

0 comments on commit 75c2407

Please sign in to comment.