Skip to content

Commit 0bb2a8d

Browse files
Fixed incorrect port
1 parent c61fb0f commit 0bb2a8d

File tree

1 file changed

+21
-1
lines changed
  • src/Compose/ProductionBuilder/Service

1 file changed

+21
-1
lines changed

src/Compose/ProductionBuilder/Service/Tls.php

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function getConfig(Config $config): array
6262
'aliases' => [$config->getHost()]
6363
]
6464
],
65-
'environment' => ['UPSTREAM_HOST' => $this->getBackendService($config)],
65+
'environment' => $this->getBackendServiceUpstream($config),
6666
'ports' => [
6767
$config->getPort() . ':80',
6868
$config->getTlsPort() . ':443'
@@ -100,4 +100,24 @@ private function getBackendService(Config $config): string
100100
? BuilderInterface::SERVICE_VARNISH
101101
: BuilderInterface::SERVICE_WEB;
102102
}
103+
104+
/**
105+
* @param Config $config
106+
* @return string[]
107+
* @throws ConfigurationMismatchException
108+
*/
109+
private function getBackendServiceUpstream(Config $config): array
110+
{
111+
if ($config->hasServiceEnabled(ServiceInterface::SERVICE_VARNISH)) {
112+
return [
113+
'UPSTREAM_HOST=' . BuilderInterface::SERVICE_VARNISH,
114+
'UPSTREAM_PORT=80'
115+
];
116+
}
117+
118+
return [
119+
'UPSTREAM_HOST=' . BuilderInterface::SERVICE_WEB,
120+
'UPSTREAM_PORT=8080'
121+
];
122+
}
103123
}

0 commit comments

Comments
 (0)