Skip to content

Instantly share code, notes, and snippets.

@hq9000
Created March 3, 2021 04:48
Show Gist options
  • Save hq9000/f2fbb8dcf6a2a3799615064f2f9c5b5e to your computer and use it in GitHub Desktop.
Save hq9000/f2fbb8dcf6a2a3799615064f2f9c5b5e to your computer and use it in GitHub Desktop.
# supported php versions:
# https://www.php.net/supported-versions.php
FROM php:7.4.11-cli
RUN apt-get update && apt-get install vim -y && \
apt-get install openssl -y && \
apt-get install libssl-dev -y && \
apt-get install wget -y && \
apt-get install git -y && \
apt-get install procps -y && \
apt-get install htop -y
# swoole release info:
# https://github.com/swoole/swoole-src
RUN cd /tmp && git clone https://github.com/swoole/swoole-src.git && \
cd swoole-src && \
git checkout v4.6.3 && \
phpize && \
./configure --enable-openssl && \
make && make install
RUN touch /usr/local/etc/php/conf.d/swoole.ini && \
echo 'extension=swoole.so' > /usr/local/etc/php/conf.d/swoole.ini
RUN apt-get install -y zlib1g-dev libicu-dev libzip-dev;\
docker-php-ext-configure intl; \
docker-php-ext-configure zip --with-libzip; \
docker-php-ext-install intl pdo_mysql zip
# swoole simply refuses to start when xdebug is enabled
# RUN pecl install xdebug; docker-php-ext-enable xdebug
#==============================================================
# Yasd
#==============================================================
RUN apt-get install -y libboost-all-dev
RUN cd ~; git clone https://github.com/swoole/yasd
RUN cd ~/yasd && phpize --clean && \
phpize && \
./configure && \
make clean && \
make && \
make install
RUN touch /usr/local/etc/php/conf.d/yasd.ini && \
echo 'zend_extension=yasd' > /usr/local/etc/php/conf.d/yasd.ini && \
echo 'yasd.debug_mode=remote' >> /usr/local/etc/php/conf.d/yasd.ini && \
echo 'yasd.remote_host=127.0.0.1' >> /usr/local/etc/php/conf.d/yasd.ini && \
echo 'yasd.remote_port=9337' >> /usr/local/etc/php/conf.d/yasd.ini
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment