Browse Source

[yii2-workerman] Add lib event (#7357)

Joan Miquel 3 years ago
parent
commit
64a0ae7e91
1 changed files with 12 additions and 6 deletions
  1. 12 6
      frameworks/PHP/yii2/yii2-workerman.dockerfile

+ 12 - 6
frameworks/PHP/yii2/yii2-workerman.dockerfile

@@ -1,16 +1,22 @@
-FROM php:8.1-cli
+FROM ubuntu:20.04
 
 
-RUN docker-php-ext-install opcache pcntl pdo_mysql
-COPY deploy/conf/cli-php.ini /usr/local/etc/php/php.ini
+ARG DEBIAN_FRONTEND=noninteractive
 
 
+RUN apt-get update -yqq && apt-get install -yqq software-properties-common > /dev/null
+RUN LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php
 RUN apt-get update -yqq > /dev/null && \
 RUN apt-get update -yqq > /dev/null && \
-    apt-get install -yqq git
+    apt-get install -yqq git php8.1-cli php8.1-mysql php8.1-mbstring php8.1-xml > /dev/null
+
+COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer
+
+RUN apt-get install -y php-pear php8.1-dev libevent-dev > /dev/null
+RUN pecl install event-3.0.6 > /dev/null && echo "extension=event.so" > /etc/php/8.1/cli/conf.d/event.ini
+
+COPY deploy/conf/cli-php.ini /etc/php/8.1/cli/php.ini
 
 
 ADD ./ /yii2
 ADD ./ /yii2
 WORKDIR /yii2
 WORKDIR /yii2
 
 
-RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer 
-
 RUN composer install --optimize-autoloader --classmap-authoritative --no-dev
 RUN composer install --optimize-autoloader --classmap-authoritative --no-dev
 
 
 RUN sed -i 's|(new  yii\\web\\Application|//(new  yii\\web\\Application|' app/index.php
 RUN sed -i 's|(new  yii\\web\\Application|//(new  yii\\web\\Application|' app/index.php