Dockerfile
FROM php:7.3.33-fpm-alpine
# php:7.3.33-fpm php:7.3.33-fpm-alpine
#WORKDIR /code
#RUN echo '这是一个本地构建php-fpm的镜像'
# mirrors.163.com
# mirrors.aliyun.com
# mirrors.ustc.edu.cn
# dl-cdn.alpinelinux.org
# mirrors.ustc.edu.cn
RUN sed -i "s/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g" /etc/apk/repositories
ARG TZ=Asia/Shanghai
RUN set -ex \
# && apk update \
&& apk --no-cache add tzdata \
&& cp "/usr/share/zoneinfo/$TZ" /etc/localtime \
&& echo "$TZ" > /etc/timezone
#mysqli
RUN docker-php-ext-install pdo pdo_mysql opcache
RUN curl -L -o /tmp/redis.tar https://pecl.php.net/get/redis-5.3.6.tgz \
&& tar -zxvf /tmp/redis.tar \
&& mkdir -p /usr/src/php/ext \
&& cp -r ./redis-5.3.6 /usr/src/php/ext/redis \
&& rm -rf ./redis-5.3.6 \
&& cd /usr/src/php/ext/redis \
&& docker-php-ext-install redis
RUN apk update && apk install librabbitmq-dev -y
RUN curl -L -o /tmp/amqp.tar https://pecl.php.net/get/amqp-1.10.2.tgz \
&& tar -zxvf /tmp/amqp.tar \
&& cp -r ./amqp-1.10.2 /usr/src/php/ext/amqp \
&& rm -rf ./amqp-1.10.2 \
&& cd /usr/src/php/ext/amqp \
&& docker-php-ext-install amqp
#安装mongodb
RUN curl -L -o /tmp/mongodb.tar https://pecl.php.net/get/mongodb-1.12.1.tgz \
&& tar -zxvf /tmp/mongodb.tar \
&& cp -r ./mongodb-1.12.1 /usr/src/php/ext/mongodb \
&& rm -rf ./mongodb-1.12.1 \
&& cd /usr/src/php/ext/mongodb \
&& docker-php-ext-install mongodb
#RUN echo "安装zip"
#RUN docker-php-ext-install zipdoc