Skip to content

Commit 1ee8870

Browse files
Merge pull request #16 from magento-commerce/imported-magento-magento-cloud-docker-296
[Imported] Fixed incorrect port
2 parents e6784c7 + 0c4b396 commit 1ee8870

File tree

7 files changed

+32
-7
lines changed

7 files changed

+32
-7
lines changed

images/nginx/1.19/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ ENV XDEBUG_HOST fpm_xdebug
55
ENV FPM_HOST fpm
66
ENV FPM_PORT 9000
77
ENV UPSTREAM_HOST web
8-
ENV UPSTREAM_PORT 80
8+
ENV UPSTREAM_PORT 8080
99
ENV MAGENTO_ROOT /app
1010
ENV MAGENTO_RUN_MODE production
1111
ENV MFTF_UTILS 0

src/Compose/ProductionBuilder/Service/Tls.php

+21-1
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
}

src/Test/Integration/_files/cloud_base/docker-compose.exp.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,8 @@ services:
110110
aliases:
111111
- magento2.docker
112112
environment:
113-
UPSTREAM_HOST: varnish
113+
- UPSTREAM_HOST=varnish
114+
- UPSTREAM_PORT=80
114115
ports:
115116
- '80:80'
116117
- '443:443'

src/Test/Integration/_files/cloud_base_mftf/docker-compose.exp.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ services:
104104
aliases:
105105
- magento2.docker
106106
environment:
107-
UPSTREAM_HOST: varnish
107+
- UPSTREAM_HOST=varnish
108+
- UPSTREAM_PORT=80
108109
ports:
109110
- '80:80'
110111
- '4443:443'

src/Test/Integration/_files/cloud_base_test/docker-compose.exp.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ services:
104104
aliases:
105105
- magento2.docker
106106
environment:
107-
UPSTREAM_HOST: varnish
107+
- UPSTREAM_HOST=varnish
108+
- UPSTREAM_PORT=80
108109
ports:
109110
- '80:80'
110111
- '4443:443'

src/Test/Integration/_files/custom_cloud_base/docker-compose.exp.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ services:
8484
aliases:
8585
- magento2.test
8686
environment:
87-
UPSTREAM_HOST: varnish
87+
- UPSTREAM_HOST=varnish
88+
- UPSTREAM_PORT=80
8889
ports:
8990
- '8080:80'
9091
- '443:443'

src/Test/Integration/_files/custom_cloud_custom_images/docker-compose.exp.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ services:
109109
aliases:
110110
- magento2.test
111111
environment:
112-
UPSTREAM_HOST: varnish
112+
- UPSTREAM_HOST=varnish
113+
- UPSTREAM_PORT=80
113114
ports:
114115
- '8080:80'
115116
- '443:443'

0 commit comments

Comments
 (0)