FROM php:7.4-fpm
RUN echo "deb http://mirrors.aliyun.com/debian/ buster main non-free contrib \n \
deb-src http://mirrors.aliyun.com/debian/ buster main non-free contrib \n \
deb http://mirrors.aliyun.com/debian-security buster/updates main \n \
deb-src http://mirrors.aliyun.com/debian-security buster/updates main \n \
deb http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib \n \
deb-src http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib \n \
deb http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib \n \
deb-src http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib" > /etc/apt/sources.list \
    # 更新及安装库
    && apt-get update \
    && apt-get install -y \
    vim net-tools \
    build-essential \
    libmagickcore-dev \
    libmagickwand-dev \
    imagemagick \
    libmcrypt-dev \
    libzip-dev \
    libmemcached-dev \
    # GD库扩展
    && apt-get install -y \
    libfreetype6-dev \
    libjpeg62-turbo-dev \
    libpng-dev \
    && docker-php-ext-configure gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ \
    && docker-php-ext-install -j$(nproc) gd \
    # PHP扩展安装
    && docker-php-ext-install -j$(nproc) bcmath calendar exif gettext sockets dba mysqli pcntl pdo_mysql shmop sysvmsg sysvsem sysvshm iconv \
    && pecl install memcached-3.1.4 \
    && pecl install redis-5.2.2 \
    && pecl install imagick mcrypt zip swoole \
    && pecl install xdebug \
    && docker-php-ext-enable memcached redis imagick mcrypt zip swoole xdebug

# 镜像信息
LABEL Author="vance"
LABEL Version="2021.3"
LABEL Description="PHP 7.4 开发环境镜像."