---
**PHP基础环境[swoole|redis|bcmath]**
```
FROM php:7.4-fpm-alpine
MAINTAINER "maXcon <409985270@qq.com>"
LABEL version="1.0.0" description="PHP add fpm,redis,swoole,bcmath"
ENV MXC_TIME_ZONE "Asia/Shanghai"
ENV MXC_SW_VER 4.5.2
ENV MXC_RS_VER 5.3.1
VOLUME /tmp /mnt /home/www-data
COPY ./composer.phar /tmp/composer.phar
ADD ./swoole-${MXC_SW_VER}.tgz /tmp
ADD ./redis-${MXC_RS_VER}.tgz /tmp
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && \
ln -sf /usr/share/zoneinfo/${MXC_TIME_ZONE} /etc/localtime && \
echo "${MXC_TIME_ZONE}" > /etc/timezone && \
apk update && apk upgrade && \
apk add --no-cache m4 autoconf make gcc g++ linux-headers && \
cd /tmp/swoole-${MXC_SW_VER} && \
(phpize && ./configure && make && make install) && \
cd /tmp/redis-${MXC_RS_VER} && \
(phpize && ./configure && make && make install) && \
docker-php-ext-enable swoole redis && \
docker-php-ext-install bcmath && \
chmod u+x /tmp/composer.phar && \
mv /tmp/composer.phar /usr/local/bin/composer && \
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer && \
apk del m4 autoconf make g++ linux-headers && \
rm -rf /var/cache/apk/* /tmp/*
WORKDIR /var/www
CMD php-fpm
```