From 894b0197e0ec92dd13314af381d15a56133b4f7f Mon Sep 17 00:00:00 2001 From: Nick Hope Date: Sun, 29 Oct 2017 12:54:05 +0000 Subject: [PATCH 1/2] Fixed: PHP-Worker has missing PGSQL drivers. --- docker-compose.yml | 2 ++ env-example | 4 ++++ php-worker/Dockerfile-70 | 7 +++++++ php-worker/Dockerfile-71 | 7 +++++++ 4 files changed, 20 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index 8bff74fd..2649ec3f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -112,6 +112,8 @@ services: build: context: ./php-worker dockerfile: "Dockerfile-${PHP_VERSION}" + args: + - INSTALL_PGSQL=${PHP_WORKER_INSTALL_PGSQL} volumes_from: - applications depends_on: diff --git a/env-example b/env-example index 692f08af..95d5e254 100644 --- a/env-example +++ b/env-example @@ -88,6 +88,10 @@ PHP_FPM_INSTALL_IMAGE_OPTIMIZERS=false PHP_FPM_INSTALL_IMAGEMAGICK=false PHP_FPM_INSTALL_PG_CLIENT=false +### PHP_WORKER ######################################################################################################### + +PHP_WORKER_INSTALL_PGSQL=false + ### NGINX ############################################################################################################## NGINX_HOST_HTTP_PORT=80 diff --git a/php-worker/Dockerfile-70 b/php-worker/Dockerfile-70 index 8b7dd601..030bf8bb 100644 --- a/php-worker/Dockerfile-70 +++ b/php-worker/Dockerfile-70 @@ -24,6 +24,13 @@ RUN apk --update add wget \ RUN docker-php-ext-install mysqli mbstring pdo pdo_mysql mcrypt tokenizer xml RUN pecl channel-update pecl.php.net && pecl install memcached && docker-php-ext-enable memcached +# Install PostgreSQL drivers: +ARG INSTALL_PGSQL=false +RUN if [ ${INSTALL_PGSQL} = true ]; then \ + apk --update add postgresql-dev \ + && docker-php-ext-install pdo_pgsql \ +;fi + RUN rm /var/cache/apk/* \ && mkdir -p /var/www diff --git a/php-worker/Dockerfile-71 b/php-worker/Dockerfile-71 index 697efb67..eeebe8da 100644 --- a/php-worker/Dockerfile-71 +++ b/php-worker/Dockerfile-71 @@ -24,6 +24,13 @@ RUN apk --update add wget \ RUN docker-php-ext-install mysqli mbstring pdo pdo_mysql mcrypt tokenizer xml RUN pecl channel-update pecl.php.net && pecl install memcached && docker-php-ext-enable memcached +# Install PostgreSQL drivers: +ARG INSTALL_PGSQL=false +RUN if [ ${INSTALL_PGSQL} = true ]; then \ + apk --update add postgresql-dev \ + && docker-php-ext-install pdo_pgsql \ +;fi + RUN rm /var/cache/apk/* \ && mkdir -p /var/www From 9e807e39eee31b8bacfbe0befc8f10933a8b5e15 Mon Sep 17 00:00:00 2001 From: Nick Hope Date: Sun, 29 Oct 2017 13:03:59 +0000 Subject: [PATCH 2/2] Updated: PHP-Worker documentation. --- DOCUMENTATION/content/documentation/index.md | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/DOCUMENTATION/content/documentation/index.md b/DOCUMENTATION/content/documentation/index.md index 4c2a8bcb..9900f648 100644 --- a/DOCUMENTATION/content/documentation/index.md +++ b/DOCUMENTATION/content/documentation/index.md @@ -541,11 +541,18 @@ b) add a new service container by simply copy-paste this section below PHP-FPM c ```yaml php-worker: build: - context: ./php-fpm - dockerfile: Dockerfile-70 # or Dockerfile-56, choose your PHP-FPM container setting + context: ./php-worker + dockerfile: "Dockerfile-${PHP_VERSION}" #Dockerfile-71 or #Dockerfile-70 available + args: + - INSTALL_PGSQL=${PHP_WORKER_INSTALL_PGSQL} #Optionally install PGSQL PHP drivers volumes_from: - applications - command: php artisan queue:work + depends_on: + - workspace + extra_hosts: + - "dockerhost:${DOCKER_HOST_IP}" + networks: + - backend ``` 2 - Start everything up