Dockerfile 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. FROM php:8.1.20-fpm
  2. RUN apt-get update && apt-get install -y \
  3. libfreetype6-dev \
  4. libjpeg62-turbo-dev \
  5. libmcrypt-dev \
  6. libpng-dev \
  7. mariadb-client \
  8. zip \
  9. libzip-dev && \
  10. # docker-php-ext-install -j$(nproc) iconv && \
  11. docker-php-ext-configure gd --with-freetype --with-jpeg && \
  12. apt-get install -y imagemagick libmagickwand-dev && \
  13. pecl install imagick && docker-php-ext-enable imagick && \
  14. docker-php-ext-install -j$(nproc) gd && \
  15. docker-php-ext-install pdo_mysql zip && \
  16. docker-php-ext-install opcache && \
  17. docker-php-ext-install bcmath
  18. RUN apt-get install -y git vim
  19. RUN pecl install redis-5.3.3 && \
  20. docker-php-ext-enable redis
  21. RUN pecl install xdebug-3.2.1 && \
  22. docker-php-ext-enable xdebug
  23. RUN export COMPOSER_HOME=/usr/local/composer && \
  24. curl -sS https://getcomposer.org/installer \
  25. | php -- --install-dir=/usr/local/bin --filename=composer
  26. # curl https://github.com/drush-ops/drush-launcher/releases/download/0.6.0/drush.phar \
  27. # -L -o /usr/local/bin/drush && \
  28. # chmod +x /usr/local/bin/drush
  29. RUN apt-get install -y rsyslog
  30. COPY ./rsyslog-drupal.conf /etc/rsyslog.d/drupal.conf
  31. # ENTRYPOINT ["sh", "-c", "service rsyslog start ; tail -f /dev/null"]
  32. COPY ./php-custom.ini /usr/local/etc/php/conf.d/php-custom.ini
  33. # COPY ./php-fpm-custom.conf /usr/local/etc/php-fpm.d/php-fpm-custom.conf
  34. # COPY ./bashrc /root/.bashrc
  35. # COPY ./inputrc /root/.inputrc
  36. ARG USER_UID
  37. ARG USER_UNAME
  38. ARG USER_GID
  39. ARG USER_GNAME
  40. RUN if getent group ${USER_GNAME} ; then groupdel ${USER_GNAME}; fi &&\
  41. groupadd -g ${USER_GID} ${USER_GNAME} &&\
  42. useradd -l -u ${USER_UID} -g ${USER_GNAME} ${USER_UNAME} &&\
  43. install -d -m 0755 -o ${USER_UNAME} -g ${USER_GNAME} /home/${USER_UNAME} &&\
  44. chown --changes --silent --no-dereference --recursive \
  45. --from=33:33 ${USER_UID}:${USER_GID} \
  46. /home/${USER_UNAME}
  47. # /.composer \
  48. # /var/run/php-fpm \
  49. # /var/lib/php/sessions \
  50. COPY ./bashrc /home/${USER_UNAME}/.bashrc
  51. COPY ./inputrc /home/${USER_UNAME}/.inputrc
  52. USER ${USER_UNAME}