diff --git a/.env b/.env index 82c5ef508f..5acb3b585f 100644 --- a/.env +++ b/.env @@ -10,8 +10,8 @@ DATABASE_PASSWORD=SetYourOwnPassword DATABASE_NAME=ezp ## Docker images (name and version) -PHP_IMAGE=ezsystems/php:7.1-v1 -PHP_IMAGE_DEV=ezsystems/php:7.1-v1-dev +PHP_IMAGE=ezsystems/php:7.2-v1 +PHP_IMAGE_DEV=ezsystems/php:7.2-v1-dev NGINX_IMAGE=nginx:stable MYSQL_IMAGE=healthcheck/mariadb SELENIUM_IMAGE=selenium/standalone-chrome-debug:3.4.0 diff --git a/.platform.app.yaml b/.platform.app.yaml index 6ffa87f1ef..68eab56d93 100644 --- a/.platform.app.yaml +++ b/.platform.app.yaml @@ -8,7 +8,7 @@ name: app # The type of the application to build. -type: php:7.1 +type: php:7.2 build: # "none" means we're running composer manually, see build hook flavor: "none" @@ -25,6 +25,8 @@ relationships: # If you wish to have a separate Redis instance for sessions, uncomment # this relationship and the corresponding service in .platform/services.yaml #redissession: 'redissession:redis' + # If you wish to use solr, uncomment this relationship and the corresponding service in .platform/services.yaml + #solr: 'solrsearch:solr' variables: #php: diff --git a/.platform/services.yaml b/.platform/services.yaml index 9ee8b931b3..616be0e1ee 100644 --- a/.platform/services.yaml +++ b/.platform/services.yaml @@ -31,3 +31,21 @@ rediscache: #redissession: # type: redis-persistent:3.2 # disk: 1024 + +# If you wish to use solr, uncomment this service and the corresponding relationship in .platform.app.yaml. +# Also, you need to generate the config using: +# vendor/ezsystems/ezplatform-solr-search-engine/bin/generate-solr-config.sh +#solrsearch: +# type: solr:6.6 +# disk: 512 +# configuration: +# configsets: +# mainconfig: !archive "configsets/solr6" +# cores: +# collection1: +# core_properties: | +# configSet=mainconfig +# schema=schema.xml +# endpoints: +# collection1: +# core: collection1 diff --git a/app/config/env/platformsh.php b/app/config/env/platformsh.php index 17da9fc5a0..86b831f06d 100644 --- a/app/config/env/platformsh.php +++ b/app/config/env/platformsh.php @@ -119,3 +119,14 @@ $container->setParameter('session.save_path', sprintf('%s:%d', $endpoint['host'], $endpoint['port'])); } } + +if (isset($relationships['solr'])) { + foreach ($relationships['solr'] as $endpoint) { + if ($endpoint['scheme'] !== 'solr') { + continue; + } + + $container->setParameter('search_engine', 'solr'); + $container->setParameter('solr_dsn', sprintf('http://%s:%d/%s', $endpoint['host'], $endpoint['port'], 'solr')); + } +} diff --git a/doc/docker/Dockerfile-app b/doc/docker/Dockerfile-app index 03773bfc31..ca1fc68865 100644 --- a/doc/docker/Dockerfile-app +++ b/doc/docker/Dockerfile-app @@ -1,4 +1,5 @@ -FROM ezsystems/php:7.1-v1 as builder +ARG PHP_IMAGE=ezsystems/php:7.2-v1 +FROM ${PHP_IMAGE} as builder # This is prod image (for dev use just mount your application as host volume into php image we extend here) ENV SYMFONY_ENV=prod @@ -26,7 +27,7 @@ RUN rm -Rf app/logs/* app/cache/*/* RUN rm -rf web/css web/fonts web/js web/var -FROM ezsystems/php:7.1-v1 +FROM ${PHP_IMAGE} # This is prod image (for dev use just mount your application as host volume into php image we extend here) ENV SYMFONY_ENV=prod diff --git a/doc/docker/Dockerfile-nginx b/doc/docker/Dockerfile-nginx index 37e4c73f84..181fc10d13 100644 --- a/doc/docker/Dockerfile-nginx +++ b/doc/docker/Dockerfile-nginx @@ -1,4 +1,5 @@ -FROM ezsystems/php:7.1-v1 as web-build +ARG PHP_IMAGE=ezsystems/php:7.2-v1 +FROM ${PHP_IMAGE} as web-build ENV SYMFONY_ENV=prod diff --git a/doc/docker/base-prod.yml b/doc/docker/base-prod.yml index a9bc3cf358..0d197943a7 100644 --- a/doc/docker/base-prod.yml +++ b/doc/docker/base-prod.yml @@ -6,6 +6,8 @@ services: build: context: ../../ dockerfile: ${APP_DOCKER_FILE} + args: + - PHP_IMAGE depends_on: - db environment: @@ -30,6 +32,8 @@ services: build: context: ../../ dockerfile: doc/docker/Dockerfile-nginx + args: + - PHP_IMAGE depends_on: - app ports: diff --git a/doc/docker/distribution.yml b/doc/docker/distribution.yml index 7cb28fe4fb..5a2225372a 100644 --- a/doc/docker/distribution.yml +++ b/doc/docker/distribution.yml @@ -14,7 +14,7 @@ services: - backend app: - image: ezsystems/php:7.1-v1 + image: ${PHP_IMAGE} depends_on: - db - distribution @@ -39,7 +39,7 @@ services: - vardir:/var/www/web/var web: - image: nginx:stable + image: ${NGINX_IMAGE} depends_on: - distribution - app diff --git a/web/app.php b/web/app.php index 8ae8d95335..bf261f9c30 100644 --- a/web/app.php +++ b/web/app.php @@ -18,12 +18,12 @@ $useDebugging = $environment === 'dev'; } -// Depending on SYMFONY_CLASSLOADER_FILE use custom class loader, otherwise use bootstrap cache, or autoload in debug +// Depending on SYMFONY_CLASSLOADER_FILE use custom class loader, otherwise use normal autoload and optionally bootstrap cache on PHP 5 when not in debug mode if ($loaderFile = getenv('SYMFONY_CLASSLOADER_FILE')) { require_once $loaderFile; } else { require_once __DIR__ . '/../app/autoload.php'; - if (!$useDebugging) { + if (!$useDebugging && PHP_VERSION_ID < 70000) { require_once __DIR__ . '/../app/bootstrap.php.cache'; } }