Dockerfile 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. FROM php:7.3-fpm
  2. RUN apt-get update && apt-get install -y \
  3. libfreetype6-dev \
  4. libjpeg62-turbo-dev \
  5. libmcrypt-dev \
  6. libpng-dev \
  7. zip \
  8. libzip-dev && \
  9. # docker-php-ext-install -j$(nproc) iconv && \
  10. docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ && \
  11. apt-get install -y imagemagick libmagickwand-dev && \
  12. pecl install imagick && docker-php-ext-enable imagick && \
  13. docker-php-ext-install -j$(nproc) gd && \
  14. docker-php-ext-install zip && \
  15. docker-php-ext-install opcache && \
  16. docker-php-ext-install bcmath && \
  17. apt-get install -y git vim && \
  18. pecl install redis-4.3.0 && \
  19. pecl install xdebug-2.7.0 && \
  20. docker-php-ext-enable redis xdebug
  21. RUN export COMPOSER_HOME=/usr/local/composer && \
  22. curl -sS https://getcomposer.org/installer \
  23. | php -- --install-dir=/usr/local/bin --filename=composer
  24. COPY ./php-custom.ini /usr/local/etc/php/conf.d/php-custom.ini
  25. ARG USER_UID
  26. ARG USER_UNAME
  27. ARG USER_GID
  28. ARG USER_GNAME
  29. RUN if getent group ${USER_GNAME} ; then groupdel ${USER_GNAME}; fi &&\
  30. groupadd -g ${USER_GID} ${USER_GNAME} &&\
  31. useradd -l -u ${USER_UID} -g ${USER_GNAME} ${USER_UNAME} &&\
  32. install -d -m 0755 -o ${USER_UNAME} -g ${USER_GNAME} /home/${USER_UNAME} &&\
  33. chown --changes --silent --no-dereference --recursive \
  34. --from=33:33 ${USER_UID}:${USER_GID} \
  35. /home/${USER_UNAME}
  36. # /.composer \
  37. # /var/run/php-fpm \
  38. # /var/lib/php/sessions \
  39. COPY ./bashrc /home/${USER_UNAME}/.bashrc
  40. COPY ./inputrc /home/${USER_UNAME}/.inputrc
  41. USER ${USER_UNAME}