Last active
April 9, 2019 11:49
-
-
Save xialeistudio/104d11cfbbfe7f1e6d45ab87d3d63b4d to your computer and use it in GitHub Desktop.
docker-alpine-swoole
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM alpine | |
LABEL maintainer="xialeistudio<xialeistudio@gmail.com>" | |
# 修改镜像源 | |
WORKDIR /root | |
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories | |
RUN apk update | |
# 安装PHP扩展 | |
RUN apk add php7-cli php7-dev \ | |
php7-xml \ | |
php7-openssl \ | |
php7-opcache \ | |
php7-mysqlnd \ | |
php7-sockets \ | |
php7-zip \ | |
php7-pcntl \ | |
php7-pdo_mysql \ | |
php7-mysqli \ | |
php7-mbstring \ | |
php7-exif \ | |
php7-bcmath \ | |
php7-calendar \ | |
php7-gettext \ | |
php7-shmop \ | |
php7-sysvmsg \ | |
php7-sysvsem \ | |
php7-sysvshm \ | |
php7-curl \ | |
php7-soap \ | |
php7-xmlrpc \ | |
php7-bz2 \ | |
gcc g++ make autoconf pcre-dev \ | |
openssl openssl-dev | |
# 安装swoole | |
RUN wget https://github.com/swoole/swoole-src/archive/v4.3.1.tar.gz | |
RUN tar xfz v4.3.1.tar.gz | |
WORKDIR /root/swoole-src-4.3.1 | |
RUN phpize | |
RUN ./configure --enable-openssl \ | |
--enable-http2 \ | |
--enable-sockets \ | |
--enable-mysqlnd | |
RUN make && make install | |
RUN echo "extension=swoole.so" > /etc/php7/conf.d/01_swoole.ini | |
# 安装composer | |
RUN php -r "copy('https://install.phpcomposer.com/installer', 'composer-setup.php');" \ | |
&& php composer-setup.php \ | |
&& php -r "unlink('composer-setup.php');" \ | |
&& mv composer.phar /bin/composer \ | |
&& composer config -g repo.packagist composer https://packagist.phpcomposer.com | |
WORKDIR /root | |
ADD index.php . | |
EXPOSE 9501 | |
CMD ["/usr/bin/php", "/root/index.php"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment