Skip to content

Commit 0ca8dc1

Browse files
authored
Merge pull request #23 from magento-commerce/develop
Release 1.2.1
2 parents 09872ff + 22fcd62 commit 0ca8dc1

File tree

77 files changed

+1937
-77
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+1937
-77
lines changed

Diff for: codeception.dist.yml

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ modules:
2626
composer_magento_password: "%REPO_PASSWORD%"
2727
composer_github_token: "%GITHUB_TOKEN%"
2828
use_generated_images: false
29+
generated_images_namespace: "cloudft"
2930
use_cached_workdir: true
3031
version_generated_images: "%TRAVIS_BUILD_NUMBER%"
3132
printOutput: false

Diff for: composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "magento/magento-cloud-docker",
33
"description": "Magento Cloud Docker",
44
"type": "magento2-component",
5-
"version": "1.2.0",
5+
"version": "1.2.1",
66
"license": [
77
"OSL-3.0",
88
"AFL-3.0"

Diff for: images/nginx/1.19/Dockerfile

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1-
FROM nginx
1+
FROM nginx:1.19
22

33
ENV UPLOAD_MAX_FILESIZE 64M
44
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
1212
ENV DEBUG false
13+
ENV NGINX_WORKER_PROCESSES 1
14+
ENV NGINX_WORKER_CONNECTIONS 1024
1315

1416
COPY etc/nginx.conf /etc/nginx/
1517
COPY etc/vhost.conf /etc/nginx/conf.d/default.conf

Diff for: images/nginx/1.19/docker-entrypoint.sh

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ XDEBUG_UPSTREAM_FILE="/etc/nginx/conf.d/xdebug/upstream.conf"
1818
[ ! -z "${UPLOAD_MAX_FILESIZE}" ] && sed -i "s/!UPLOAD_MAX_FILESIZE!/${UPLOAD_MAX_FILESIZE}/" $VHOST_FILE
1919
[ ! -z "${WITH_XDEBUG}" ] && sed -i "s/!WITH_XDEBUG!/${WITH_XDEBUG}/" $VHOST_FILE
2020
[ "${WITH_XDEBUG}" == "1" ] && sed -i "s/#include_xdebug_upstream/include/" $NGINX_FILE
21+
[ ! -z "${NGINX_WORKER_PROCESSES}" ] && sed -i "s/!NGINX_WORKER_PROCESSES!/${NGINX_WORKER_PROCESSES}/" $NGINX_FILE
22+
[ ! -z "${NGINX_WORKER_CONNECTIONS}" ] && sed -i "s/!NGINX_WORKER_CONNECTIONS!/${NGINX_WORKER_CONNECTIONS}/" $NGINX_FILE
2123

2224
# Check if the nginx syntax is fine, then launch.
2325
nginx -t

Diff for: images/nginx/1.19/etc/nginx.conf

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
worker_processes 2;
1+
worker_processes !NGINX_WORKER_PROCESSES!;
22

33
error_log /var/log/nginx/error.log debug;
44
pid /var/run/nginx.pid;
55

66
events {
77
# this should be equal to value of "ulimit -n"
88
# reference: https://www.digitalocean.com/community/tutorials/how-to-optimize-nginx-configuration
9-
worker_connections 1048576;
9+
worker_connections !NGINX_WORKER_CONNECTIONS!;
1010
}
1111

1212
http {

Diff for: images/php/7.2-cli/Dockerfile

+1-2
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,7 @@ RUN curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire
134134
&& mkdir -p /tmp/blackfire \
135135
&& tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp/blackfire \
136136
&& mv /tmp/blackfire/blackfire-*.so $(php -r "echo ini_get ('extension_dir');")/blackfire.so \
137-
&& ( echo extension=blackfire.so \
138-
&& echo blackfire.agent_socket=tcp://blackfire:8707 ) > $(php -i | grep "additional .ini" | awk '{print $9}')/blackfire.ini \
137+
&& echo blackfire.agent_socket=tcp://blackfire:8707 > $(php -i | grep "additional .ini" | awk '{print $9}')/blackfire.ini \
139138
&& rm -rf /tmp/blackfire /tmp/blackfire-probe.tar.gz
140139
RUN rm -f /usr/local/etc/php/conf.d/*sodium.ini \
141140
&& rm -f /usr/local/lib/php/extensions/*/*sodium.so \

Diff for: images/php/7.2-fpm/Dockerfile

+1-2
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,7 @@ RUN curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire
113113
&& mkdir -p /tmp/blackfire \
114114
&& tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp/blackfire \
115115
&& mv /tmp/blackfire/blackfire-*.so $(php -r "echo ini_get ('extension_dir');")/blackfire.so \
116-
&& ( echo extension=blackfire.so \
117-
&& echo blackfire.agent_socket=tcp://blackfire:8707 ) > $(php -i | grep "additional .ini" | awk '{print $9}')/blackfire.ini \
116+
&& echo blackfire.agent_socket=tcp://blackfire:8707 > $(php -i | grep "additional .ini" | awk '{print $9}')/blackfire.ini \
118117
&& rm -rf /tmp/blackfire /tmp/blackfire-probe.tar.gz
119118
RUN rm -f /usr/local/etc/php/conf.d/*sodium.ini \
120119
&& rm -f /usr/local/lib/php/extensions/*/*sodium.so \

Diff for: images/php/7.2-fpm/fpm-healthcheck.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22
set -eo pipefail
33

4-
fpm_response=$(curl -o /dev/null -s -w "%{http_code}\n" http://${WEB_HOST:-web}:${WEB_PORT:-80}/status)
4+
fpm_response=$(curl -o /dev/null -s -w "%{http_code}\n" http://${WEB_HOST:-web}:${WEB_PORT:-8080}/status)
55

66
if [ "$fpm_response" == "200" ]
77
then

Diff for: images/php/7.3-cli/Dockerfile

+1-2
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,7 @@ RUN curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire
131131
&& mkdir -p /tmp/blackfire \
132132
&& tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp/blackfire \
133133
&& mv /tmp/blackfire/blackfire-*.so $(php -r "echo ini_get ('extension_dir');")/blackfire.so \
134-
&& ( echo extension=blackfire.so \
135-
&& echo blackfire.agent_socket=tcp://blackfire:8707 ) > $(php -i | grep "additional .ini" | awk '{print $9}')/blackfire.ini \
134+
&& echo blackfire.agent_socket=tcp://blackfire:8707 > $(php -i | grep "additional .ini" | awk '{print $9}')/blackfire.ini \
136135
&& rm -rf /tmp/blackfire /tmp/blackfire-probe.tar.gz
137136
RUN rm -f /usr/local/etc/php/conf.d/*sodium.ini \
138137
&& rm -f /usr/local/lib/php/extensions/*/*sodium.so \

Diff for: images/php/7.3-fpm/Dockerfile

+1-2
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,7 @@ RUN curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire
110110
&& mkdir -p /tmp/blackfire \
111111
&& tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp/blackfire \
112112
&& mv /tmp/blackfire/blackfire-*.so $(php -r "echo ini_get ('extension_dir');")/blackfire.so \
113-
&& ( echo extension=blackfire.so \
114-
&& echo blackfire.agent_socket=tcp://blackfire:8707 ) > $(php -i | grep "additional .ini" | awk '{print $9}')/blackfire.ini \
113+
&& echo blackfire.agent_socket=tcp://blackfire:8707 > $(php -i | grep "additional .ini" | awk '{print $9}')/blackfire.ini \
115114
&& rm -rf /tmp/blackfire /tmp/blackfire-probe.tar.gz
116115
RUN rm -f /usr/local/etc/php/conf.d/*sodium.ini \
117116
&& rm -f /usr/local/lib/php/extensions/*/*sodium.so \

Diff for: images/php/7.3-fpm/fpm-healthcheck.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22
set -eo pipefail
33

4-
fpm_response=$(curl -o /dev/null -s -w "%{http_code}\n" http://${WEB_HOST:-web}:${WEB_PORT:-80}/status)
4+
fpm_response=$(curl -o /dev/null -s -w "%{http_code}\n" http://${WEB_HOST:-web}:${WEB_PORT:-8080}/status)
55

66
if [ "$fpm_response" == "200" ]
77
then

Diff for: images/php/7.4-cli/Dockerfile

+1-2
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,7 @@ RUN curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire
121121
&& mkdir -p /tmp/blackfire \
122122
&& tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp/blackfire \
123123
&& mv /tmp/blackfire/blackfire-*.so $(php -r "echo ini_get ('extension_dir');")/blackfire.so \
124-
&& ( echo extension=blackfire.so \
125-
&& echo blackfire.agent_socket=tcp://blackfire:8707 ) > $(php -i | grep "additional .ini" | awk '{print $9}')/blackfire.ini \
124+
&& echo blackfire.agent_socket=tcp://blackfire:8707 > $(php -i | grep "additional .ini" | awk '{print $9}')/blackfire.ini \
126125
&& rm -rf /tmp/blackfire /tmp/blackfire-probe.tar.gz
127126
RUN rm -f /usr/local/etc/php/conf.d/*sodium.ini \
128127
&& rm -f /usr/local/lib/php/extensions/*/*sodium.so \

Diff for: images/php/7.4-fpm/Dockerfile

+1-2
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,7 @@ RUN curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire
100100
&& mkdir -p /tmp/blackfire \
101101
&& tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp/blackfire \
102102
&& mv /tmp/blackfire/blackfire-*.so $(php -r "echo ini_get ('extension_dir');")/blackfire.so \
103-
&& ( echo extension=blackfire.so \
104-
&& echo blackfire.agent_socket=tcp://blackfire:8707 ) > $(php -i | grep "additional .ini" | awk '{print $9}')/blackfire.ini \
103+
&& echo blackfire.agent_socket=tcp://blackfire:8707 > $(php -i | grep "additional .ini" | awk '{print $9}')/blackfire.ini \
105104
&& rm -rf /tmp/blackfire /tmp/blackfire-probe.tar.gz
106105
RUN rm -f /usr/local/etc/php/conf.d/*sodium.ini \
107106
&& rm -f /usr/local/lib/php/extensions/*/*sodium.so \

Diff for: images/php/7.4-fpm/fpm-healthcheck.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22
set -eo pipefail
33

4-
fpm_response=$(curl -o /dev/null -s -w "%{http_code}\n" http://${WEB_HOST:-web}:${WEB_PORT:-80}/status)
4+
fpm_response=$(curl -o /dev/null -s -w "%{http_code}\n" http://${WEB_HOST:-web}:${WEB_PORT:-8080}/status)
55

66
if [ "$fpm_response" == "200" ]
77
then

Diff for: images/php/fpm/fpm-healthcheck.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22
set -eo pipefail
33

4-
fpm_response=$(curl -o /dev/null -s -w "%{http_code}\n" http://${WEB_HOST:-web}:${WEB_PORT:-80}/status)
4+
fpm_response=$(curl -o /dev/null -s -w "%{http_code}\n" http://${WEB_HOST:-web}:${WEB_PORT:-8080}/status)
55

66
if [ "$fpm_response" == "200" ]
77
then

Diff for: src/Command/BuildCompose.php

+17
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,18 @@ protected function configure(): void
186186
null,
187187
InputOption::VALUE_NONE,
188188
'Sets host.docker.internal for fpm_xdebug container to resolve debug issue for LINUX system'
189+
)->addOption(
190+
Source\CliSource::OPTION_NGINX_WORKER_PROCESSES,
191+
null,
192+
InputOption::VALUE_OPTIONAL,
193+
'The number of NGINX worker processes',
194+
Source\BaseSource::DEFAULT_NGINX_WORKER_PROCESSES
195+
)->addOption(
196+
Source\CliSource::OPTION_NGINX_WORKER_CONNECTIONS,
197+
null,
198+
InputOption::VALUE_OPTIONAL,
199+
'The maximum number of connections that each worker process can handle simultaneously',
200+
Source\BaseSource::DEFAULT_NGINX_WORKER_CONNECTIONS
189201
);
190202

191203
$this->addOption(
@@ -261,6 +273,11 @@ protected function configure(): void
261273
null,
262274
InputOption::VALUE_REQUIRED,
263275
'Port'
276+
)->addOption(
277+
Source\CliSource::OPTION_NO_TLS,
278+
null,
279+
InputOption::VALUE_NONE,
280+
'Disable TLS'
264281
)->addOption(
265282
Source\CliSource::OPTION_TLS_PORT,
266283
null,

Diff for: src/Compose/BuilderInterface.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ interface BuilderInterface
4848
public const VOLUME_MAGENTO_DB_QUOTE = 'magento-db-quote';
4949
public const VOLUME_MAGENTO_DB_SALES = 'magento-db-sales';
5050
public const VOLUME_MAGENTO_DEV = './dev';
51-
public const VOLUME_DOCKER_ETRYPOINT = '.docker/mysql/docker-entrypoint-initdb.d';
52-
public const VOLUME_DOCKER_ETRYPOINT_QUOTE = '.docker/mysql-quote/docker-entrypoint-initdb.d';
53-
public const VOLUME_DOCKER_ETRYPOINT_SALES = '.docker/mysql-sales/docker-entrypoint-initdb.d';
51+
public const VOLUME_DOCKER_ENTRYPOINT = '.docker/mysql/docker-entrypoint-initdb.d';
52+
public const VOLUME_DOCKER_ENTRYPOINT_QUOTE = '.docker/mysql-quote/docker-entrypoint-initdb.d';
53+
public const VOLUME_DOCKER_ENTRYPOINT_SALES = '.docker/mysql-sales/docker-entrypoint-initdb.d';
5454

5555
public const SYNC_ENGINE_NATIVE = 'native';
5656

Diff for: src/Compose/DeveloperBuilder.php

+2-11
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
namespace Magento\CloudDocker\Compose;
99

10-
use Magento\CloudDocker\App\ConfigurationMismatchException;
1110
use Magento\CloudDocker\Compose\Php\ExtensionResolver;
1211
use Magento\CloudDocker\Config\Config;
1312
use Magento\CloudDocker\Config\Environment\Converter;
@@ -97,14 +96,6 @@ public function build(Config $config): Manager
9796
$volumes = [$volumePrefix . self::VOLUME_MAGENTO_SYNC . ':' . self::DIR_MAGENTO . ':nocopy'];
9897
}
9998

100-
if ($config->hasMariaDbConf()) {
101-
$volumesList[$volumePrefix . self::VOLUME_MARIADB_CONF] = [];
102-
}
103-
104-
if ($config->hasDbEntrypoint()) {
105-
$volumesList[self::VOLUME_DOCKER_ETRYPOINT] = [];
106-
}
107-
10899
$manager->setVolumes($volumesList);
109100

110101
/**
@@ -129,11 +120,11 @@ public function build(Config $config): Manager
129120
];
130121

131122
if ($config->hasMariaDbConf()) {
132-
$dbVolumes[] = $volumePrefix . self::VOLUME_MARIADB_CONF . ':/etc/mysql/mariadb.conf.d';
123+
$dbVolumes[] = self::VOLUME_MARIADB_CONF . ':/etc/mysql/mariadb.conf.d';
133124
}
134125

135126
if ($config->hasDbEntrypoint()) {
136-
$dbVolumes[] = self::VOLUME_DOCKER_ETRYPOINT . ':/docker-entrypoint-initdb.d';
127+
$dbVolumes[] = self::VOLUME_DOCKER_ENTRYPOINT . ':/docker-entrypoint-initdb.d';
137128
}
138129

139130
$manager->updateService(self::SERVICE_DB, [

Diff for: src/Compose/Php/ExtensionResolver.php

+2-3
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class ExtensionResolver
4646
'sysvsem',
4747
'sysvshm',
4848
'opcache',
49-
'zip',
49+
'zip'
5050
];
5151

5252
/**
@@ -172,8 +172,7 @@ public static function getConfig(): array
172172
mkdir -p /tmp/blackfire
173173
tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp/blackfire
174174
mv /tmp/blackfire/blackfire-*.so $(php -r "echo ini_get ('extension_dir');")/blackfire.so
175-
( echo extension=blackfire.so
176-
echo blackfire.agent_socket=tcp://blackfire:8707 ) > $(php -i | grep "additional .ini" | awk '{print $9}')/blackfire.ini
175+
echo blackfire.agent_socket=tcp://blackfire:8707 > $(php -i | grep "additional .ini" | awk '{print $9}')/blackfire.ini
177176
rm -rf /tmp/blackfire /tmp/blackfire-probe.tar.gz
178177
BASH
179178
// phpcs:enable

Diff for: src/Compose/ProductionBuilder.php

+23-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
namespace Magento\CloudDocker\Compose;
99

10+
use Magento\CloudDocker\App\ConfigurationMismatchException;
11+
use Magento\CloudDocker\Compose\ProductionBuilder\ServiceBuilderInterface;
1012
use Magento\CloudDocker\Compose\ProductionBuilder\ServicePool;
1113
use Magento\CloudDocker\Compose\ProductionBuilder\VolumeResolver;
1214
use Magento\CloudDocker\Config\Config;
@@ -35,7 +37,6 @@ class ProductionBuilder implements BuilderInterface
3537
self::SERVICE_GENERIC,
3638
self::SERVICE_DEPLOY,
3739
self::SERVICE_BUILD,
38-
self::SERVICE_TLS,
3940
self::SERVICE_WEB,
4041
self::SERVICE_FPM,
4142
self::SERVICE_DB,
@@ -91,7 +92,7 @@ public function build(Config $config): Manager
9192
$manager = $this->managerFactory->create($config);
9293

9394
foreach ($this->servicePool->getServices() as $service) {
94-
if ($config->hasServiceEnabled($service->getServiceName())
95+
if ($this->hasServiceEnabled($service, $config)
9596
|| in_array($service->getName(), self::$requiredServices)
9697
) {
9798
$manager->addService($service);
@@ -135,4 +136,24 @@ public function getPath(): string
135136
{
136137
return $this->fileList->getMagentoDockerCompose();
137138
}
139+
140+
/**
141+
* Checks the availability of the service
142+
*
143+
* @param ServiceBuilderInterface $service
144+
* @param Config $config
145+
* @return bool
146+
* @throws ConfigurationMismatchException
147+
*/
148+
private function hasServiceEnabled(ServiceBuilderInterface $service, Config $config): bool
149+
{
150+
$serviceNames = [
151+
BuilderInterface::SERVICE_FPM_XDEBUG,
152+
BuilderInterface::SERVICE_DB_QUOTE,
153+
BuilderInterface::SERVICE_DB_SALES,
154+
];
155+
$service = in_array($service->getName(), $serviceNames) ? $service->getServiceName() : $service->getName();
156+
157+
return $config->hasServiceEnabled($service);
158+
}
138159
}

Diff for: src/Compose/ProductionBuilder/Service/Database/Db.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ private function getMounts(Config $config): array
118118
$mounts[] = $config->getNameWithPrefix() . BuilderInterface::VOLUME_MAGENTO_DB . ':/var/lib/mysql';
119119

120120
if ($config->hasDbEntrypoint()) {
121-
$mounts[] = BuilderInterface::VOLUME_DOCKER_ETRYPOINT . ':/docker-entrypoint-initdb.d';
121+
$mounts[] = BuilderInterface::VOLUME_DOCKER_ENTRYPOINT . ':/docker-entrypoint-initdb.d';
122122
}
123123

124124
return $mounts;

Diff for: src/Compose/ProductionBuilder/Service/Database/DbQuote.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ private function getMounts(Config $config): array
113113
}
114114

115115
$mounts[] = BuilderInterface::VOLUME_MAGENTO_DB_QUOTE . ':/var/lib/mysql';
116-
$mounts[] = BuilderInterface::VOLUME_DOCKER_ETRYPOINT_QUOTE . ':/docker-entrypoint-initdb.d';
116+
$mounts[] = BuilderInterface::VOLUME_DOCKER_ENTRYPOINT_QUOTE . ':/docker-entrypoint-initdb.d';
117117

118118
return $mounts;
119119
}

Diff for: src/Compose/ProductionBuilder/Service/Database/DbSales.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ private function getMounts(Config $config): array
113113
}
114114

115115
$mounts[] = BuilderInterface::VOLUME_MAGENTO_DB_SALES . ':/var/lib/mysql';
116-
$mounts[] = BuilderInterface::VOLUME_DOCKER_ETRYPOINT_SALES . ':/docker-entrypoint-initdb.d';
116+
$mounts[] = BuilderInterface::VOLUME_DOCKER_ENTRYPOINT_SALES . ':/docker-entrypoint-initdb.d';
117117

118118
return $mounts;
119119
}

Diff for: src/Compose/ProductionBuilder/Service/Tls.php

+26-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->getEnvironmentVariables($config),
6666
'ports' => [
6767
$config->getPort() . ':80',
6868
$config->getTlsPort() . ':443'
@@ -100,4 +100,29 @@ 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 getEnvironmentVariables(Config $config): array
110+
{
111+
$envVariables = [
112+
'NGINX_WORKER_PROCESSES=' . $config->getNginxWorkerProcesses(),
113+
'NGINX_WORKER_CONNECTIONS=' . $config->getNginxWorkerConnections(),
114+
];
115+
116+
if ($config->hasServiceEnabled(ServiceInterface::SERVICE_VARNISH)) {
117+
$envVariables[] = 'UPSTREAM_HOST=' . BuilderInterface::SERVICE_VARNISH;
118+
$envVariables[] = 'UPSTREAM_PORT=80';
119+
120+
return $envVariables;
121+
}
122+
123+
$envVariables[] = 'UPSTREAM_HOST=' . BuilderInterface::SERVICE_WEB;
124+
$envVariables[] = 'UPSTREAM_PORT=8080';
125+
126+
return $envVariables;
127+
}
103128
}

0 commit comments

Comments
 (0)