FROM php:7.4-cli
RUN cp /usr/local/etc/php/php.ini-development /usr/local/etc/php/php.ini \
&& apt update -y \
&& apt install -y vim procps wget zip unzip openssl \
libssl-dev libcurl4-openssl-dev \
&& docker-php-source extract \
&& docker-php-ext-install pcntl \
&& wget -O ~/swoole.tgz https://pecl.php.net/get/swoole-4.8.12.tgz \
&& mkdir -m 0777 -p /usr/src/php/ext/swoole \
&& tar -xvf ~/swoole.tgz -C ~/ \
&& mv ~/swoole-4.8.12/* /usr/src/php/ext/swoole \
&& docker-php-ext-configure swoole --enable-openssl --enable-swoole-curl --enable-http2 --enable-swoole-json \
&& docker-php-ext-install swoole \
&& rm -rf /usr/src/php/ext/swoole \
&& rm -f ~/swoole.tgz \
&& wget -O ~/composer-setup.php https://install.phpcomposer.com/installer \
&& php ~/composer-setup.php \
&& mv composer.phar /usr/local/bin/composer \
&& rm -f ~/composer-setup.php
ENTRYPOINT ["/bin/bash"]