mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-02-28 15:57:09 +08:00
Merge pull request #3482 from nextcloud/enh/noid/overwrite-values-during-dockeractionmanager
This commit is contained in:
commit
dd9c828095
2 changed files with 16 additions and 12 deletions
|
@ -99,17 +99,7 @@ class ContainerDefinitionFetcher
|
|||
|
||||
$ports = new ContainerPorts();
|
||||
if (isset($entry['ports'])) {
|
||||
foreach ($entry['ports'] as $value) {
|
||||
if ($value['port_number'] === '%APACHE_PORT%') {
|
||||
$value['port_number'] = $this->configurationManager->GetApachePort();
|
||||
} elseif ($value['port_number'] === '%TALK_PORT%') {
|
||||
$value['port_number'] = $this->configurationManager->GetTalkPort();
|
||||
}
|
||||
|
||||
if ($value['ip_binding'] === '%APACHE_IP_BINDING%') {
|
||||
$value['ip_binding'] = $this->configurationManager->GetApacheIPBinding();
|
||||
}
|
||||
|
||||
foreach ($entry['ports'] as $value) {
|
||||
$ports->AddPort(
|
||||
new ContainerPort(
|
||||
$value['port_number'],
|
||||
|
|
|
@ -424,7 +424,13 @@ class DockerActionManager
|
|||
$exposedPorts = [];
|
||||
if ($container->GetInternalPort() !== 'host') {
|
||||
foreach($container->GetPorts()->GetPorts() as $value) {
|
||||
$portWithProtocol = $value->port . '/' . $value->protocol;
|
||||
$port = $value->port;
|
||||
if ($port === '%APACHE_PORT%') {
|
||||
$port = $this->configurationManager->GetApachePort();
|
||||
} else if ($port === '%TALK_PORT%') {
|
||||
$port = $this->configurationManager->GetTalkPort();
|
||||
}
|
||||
$portWithProtocol = $port . '/' . $value->protocol;
|
||||
$exposedPorts[$portWithProtocol] = null;
|
||||
}
|
||||
$requestBody['HostConfig']['NetworkMode'] = 'nextcloud-aio';
|
||||
|
@ -436,7 +442,15 @@ class DockerActionManager
|
|||
$requestBody['ExposedPorts'] = $exposedPorts;
|
||||
foreach ($container->GetPorts()->GetPorts() as $value) {
|
||||
$port = $value->port;
|
||||
if ($port === '%APACHE_PORT%') {
|
||||
$port = $this->configurationManager->GetApachePort();
|
||||
} else if ($port === '%TALK_PORT%') {
|
||||
$port = $this->configurationManager->GetTalkPort();
|
||||
}
|
||||
$ipBinding = $value->ipBinding;
|
||||
if ($ipBinding === '%APACHE_IP_BINDING%') {
|
||||
$ipBinding = $this->configurationManager->GetApacheIPBinding();
|
||||
}
|
||||
$protocol = $value->protocol;
|
||||
$portWithProtocol = $port . '/' . $protocol;
|
||||
$requestBody['HostConfig']['PortBindings'][$portWithProtocol] = [
|
||||
|
|
Loading…
Reference in a new issue