diff --git a/Dockerfile b/Dockerfile index 1beebde..be47560 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,13 +25,18 @@ RUN apk add --no-cache php7-fpm \ php7-dom \ php7-iconv \ php7-mbstring \ + php7-openssl \ + php7-session \ php7-tokenizer \ php7-zip \ php7-pecl-zmq \ php7-pecl-mongodb \ supervisor \ fcgi \ + && cp docker/*-fpm.conf /etc/php7/php-fpm.d/ \ && php bin/console cache:warmup \ && crontab /var/www/html/docker/crontab +EXPOSE 9000 + ENTRYPOINT ["supervisord", "--configuration", "/var/www/html/docker/supervisord.conf"] diff --git a/docker/docker-fpm.conf b/docker/docker-fpm.conf new file mode 100644 index 0000000..6791334 --- /dev/null +++ b/docker/docker-fpm.conf @@ -0,0 +1,11 @@ +[global] +error_log = /proc/self/fd/2 + +[www] +; if we send this to /proc/self/fd/1, it never appears +access.log = /proc/self/fd/2 + +clear_env = no + +; Ensure worker stdout and stderr are sent to the main error log. +catch_workers_output = yes diff --git a/docker/supervisord.conf b/docker/supervisord.conf index 58333a7..50a02aa 100644 --- a/docker/supervisord.conf +++ b/docker/supervisord.conf @@ -3,7 +3,7 @@ nodaemon=true user=root [program:php-fpm] -command=php-fpm +command=php-fpm7 -F stderr_logfile = /dev/stderr stderr_logfile_maxbytes=0 stdout_logfile = /dev/stdout diff --git a/docker/zz-docker-fpm.conf b/docker/zz-docker-fpm.conf new file mode 100644 index 0000000..e0590d8 --- /dev/null +++ b/docker/zz-docker-fpm.conf @@ -0,0 +1,5 @@ +[global] +daemonize = no + +[www] +listen = 9000 diff --git a/src/Service/Board/ZMQ/ClientService.php b/src/Service/Board/ZMQ/ClientService.php index cb6752c..5a9e9a9 100644 --- a/src/Service/Board/ZMQ/ClientService.php +++ b/src/Service/Board/ZMQ/ClientService.php @@ -70,6 +70,8 @@ public function send(string $message, Channel $channel): void public function __destruct() { - $this->socket->close(); + if ($this->socket) { + $this->socket->close(); + } } }