From c493a2120765da1fcd9250285d2289ea038fb266 Mon Sep 17 00:00:00 2001 From: Alexander Pankratov Date: Wed, 4 Nov 2020 13:48:54 +0300 Subject: [PATCH] Add event lib configuration && optimize docker image --- Dockerfile | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 86ab8ad..925e032 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,21 +1,29 @@ FROM php:7.4-zts -COPY . /app -WORKDIR /app - ADD https://github.com/ufoscout/docker-compose-wait/releases/download/2.7.3/wait /usr/local/bin/docker-compose-wait RUN apt-get update && apt-get upgrade -y \ - && cp -a docker/php/conf.d/. "$PHP_INI_DIR/conf.d/" \ && apt-get install apt-utils -y \ && apt-get install git zip vim libzip-dev libgmp-dev libevent-dev libssl-dev libnghttp2-dev libffi-dev -y \ && docker-php-ext-install -j$(nproc) sockets zip gmp pcntl bcmath ffi \ - && PHP_OPENSSL=yes pecl install ev event parallel \ - && docker-php-ext-enable ev event parallel \ + && docker-php-source extract \ + && cd /usr/src/php/ext/ \ + && pecl bundle event \ + && pecl bundle ev \ + && pecl bundle parallel \ + && docker-php-ext-configure event --with-event-core --with-event-extra --with-event-pthreads \ + && docker-php-ext-install -j$(nproc) ev event parallel \ && docker-php-source delete \ && apt-get autoremove --purge -y && apt-get autoclean -y && apt-get clean -y \ + && rm -rf /usr/src \ && chmod +x /usr/local/bin/docker-compose-wait \ - && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \ + && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer + +COPY . /app +WORKDIR /app + +RUN cd /app \ + && cp -a docker/php/conf.d/. "$PHP_INI_DIR/conf.d/" \ && composer install --no-dev \ && composer clear