diff --git a/composer.json b/composer.json index bd00a90a..cc61db95 100644 --- a/composer.json +++ b/composer.json @@ -42,7 +42,7 @@ "zendframework/zend-expressive-fastroute": "^3.0", "zendframework/zend-expressive-helpers": "^5.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-inputfilter": "^2.8", "zendframework/zend-paginator": "^2.6", diff --git a/config/autoload/swoole.local.php.dist b/config/autoload/swoole.local.php.dist new file mode 100644 index 00000000..017d17eb --- /dev/null +++ b/config/autoload/swoole.local.php.dist @@ -0,0 +1,21 @@ + [ + 'hot-code-reload' => [ + 'enable' => true, + ], + ], + + 'dependencies' => [ + 'factories' => [ + InotifyFileWatcher::class => InvokableFactory::class, + ], + ], + +]; diff --git a/data/infra/swoole.Dockerfile b/data/infra/swoole.Dockerfile index 1695e82c..6b647a42 100644 --- a/data/infra/swoole.Dockerfile +++ b/data/infra/swoole.Dockerfile @@ -5,6 +5,7 @@ ENV PREDIS_VERSION 4.2.0 ENV MEMCACHED_VERSION 3.1.3 ENV APCU_VERSION 5.1.16 ENV APCU_BC_VERSION 1.0.4 +ENV INOTIFY_VERSION 2.0.0 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 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 # 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 && \