Added config to reload swoole during development

This commit is contained in:
Alejandro Celaya 2019-02-24 13:22:44 +01:00
parent 1a1868c7f4
commit 249b8a4768
3 changed files with 33 additions and 1 deletions

View file

@ -42,7 +42,7 @@
"zendframework/zend-expressive-fastroute": "^3.0", "zendframework/zend-expressive-fastroute": "^3.0",
"zendframework/zend-expressive-helpers": "^5.0", "zendframework/zend-expressive-helpers": "^5.0",
"zendframework/zend-expressive-platesrenderer": "^2.0", "zendframework/zend-expressive-platesrenderer": "^2.0",
"zendframework/zend-expressive-swoole": "^2.2", "zendframework/zend-expressive-swoole": "^2.3",
"zendframework/zend-i18n": "^2.7", "zendframework/zend-i18n": "^2.7",
"zendframework/zend-inputfilter": "^2.8", "zendframework/zend-inputfilter": "^2.8",
"zendframework/zend-paginator": "^2.6", "zendframework/zend-paginator": "^2.6",

View file

@ -0,0 +1,21 @@
<?php
declare(strict_types=1);
use Zend\Expressive\Swoole\HotCodeReload\FileWatcher\InotifyFileWatcher;
use Zend\ServiceManager\Factory\InvokableFactory;
return [
'zend-expressive-swoole' => [
'hot-code-reload' => [
'enable' => true,
],
],
'dependencies' => [
'factories' => [
InotifyFileWatcher::class => InvokableFactory::class,
],
],
];

View file

@ -5,6 +5,7 @@ ENV PREDIS_VERSION 4.2.0
ENV MEMCACHED_VERSION 3.1.3 ENV MEMCACHED_VERSION 3.1.3
ENV APCU_VERSION 5.1.16 ENV APCU_VERSION 5.1.16
ENV APCU_BC_VERSION 1.0.4 ENV APCU_BC_VERSION 1.0.4
ENV INOTIFY_VERSION 2.0.0
RUN apk update RUN apk update
@ -76,6 +77,16 @@ RUN rm /tmp/apcu_bc.tar.gz
RUN rm /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini RUN rm /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini
RUN echo extension=apcu.so > /usr/local/etc/php/conf.d/20-php-ext-apcu.ini RUN echo extension=apcu.so > /usr/local/etc/php/conf.d/20-php-ext-apcu.ini
# Install inotify extension
ADD https://pecl.php.net/get/inotify-$INOTIFY_VERSION.tgz /tmp/inotify.tar.gz
RUN mkdir -p /usr/src/php/ext/inotify\
&& tar xf /tmp/inotify.tar.gz -C /usr/src/php/ext/inotify --strip-components=1
# configure and install
RUN docker-php-ext-configure inotify\
&& docker-php-ext-install inotify
# cleanup
RUN rm /tmp/inotify.tar.gz
# Install swoole # Install swoole
# First line fixes an error when installing pecl extensions. Found in https://github.com/docker-library/php/issues/233 # First line fixes an error when installing pecl extensions. Found in https://github.com/docker-library/php/issues/233
RUN apk add --no-cache --virtual .phpize-deps $PHPIZE_DEPS && \ RUN apk add --no-cache --virtual .phpize-deps $PHPIZE_DEPS && \