Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions generator/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ public function encode($value)
$defaultPort = $projectData['_defaultPort'] = getDefaultPort($projectData);
$hosts = $projectData['_hosts'] = retrieveHostNames($projectData);
$projectData['_phpExtensions'] = buildPhpExtensionList($projectData);
$projectData['_phpSpx'] = buildPhpSpx($projectData);
$projectData['_phpIni'] = buildPhpIniAdditionalConfig($projectData);
$projectData['_envs'] = array_merge(
getAdditionalEnvVariables($projectData),
Expand Down Expand Up @@ -1102,6 +1103,22 @@ function buildPhpExtensionList(array $projectData): array
return $projectData['image']['php']['enabled-extensions'] ?? [];
}

/**
* @param array $projectData
*
* @return array
*/
function buildPhpSpx(array $projectData): array
{
$configs = $projectData['image']['php']['php-spx'] ?? [];

if (count($configs) === 0) {
return [];
}

return array_merge(...$configs);
}

/**
* @param array $projectData
*
Expand Down
23 changes: 23 additions & 0 deletions images/common/application/Dockerfile.twig
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,29 @@ RUN mv /usr/local/etc/php/disabled/{{phpExtention}}.ini /usr/local/etc/php/conf.

COPY php/conf.d/99-from-deploy-yaml-php.ini /usr/local/etc/php/conf.d/

# PHP-SPX
{% if _phpSpx is defined and _phpSpx.enabled|default(false) %}
RUN apk add --no-cache \
git \
autoconf \
build-base \
zlib-dev

RUN git clone https://github.com/NoiseByNorthwest/php-spx.git \
&& cd php-spx \
&& git checkout release/latest \
&& phpize \
&& ./configure \
&& make \
&& make install

RUN echo "extension=spx.so" > /usr/local/etc/php/conf.d/spx.ini && \
echo "spx.http_enabled={{ _phpSpx.http_enabled|default(0) }}" >> /usr/local/etc/php/conf.d/spx.ini && \
echo "spx.http_key=\"{{ _phpSpx.key|default("dev") }}\"" >> /usr/local/etc/php/conf.d/spx.ini && \
echo "spx.data_dir=\"{{ _phpSpx.data_dir|default("/data/data/tmp/spx") }}\"" >> /usr/local/etc/php/conf.d/spx.ini && \
echo "spx.http_ip_whitelist=\"{{ _phpSpx.http_ip_whitelist|default("*") }}\"" >> /usr/local/etc/php/conf.d/spx.ini
{% endif %}

# Jenkins
COPY --chown=spryker:spryker jenkins/jenkins.docker.xml.twig /home/spryker/jenkins.docker.xml.twig

Expand Down