Dockerfile 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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 redis 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://drupalconsole.com/installer \
  27. -L -o /usr/local/bin/drupal && \
  28. chmod +x /usr/local/bin/drupal && \
  29. curl https://github.com/drush-ops/drush-launcher/releases/download/0.6.0/drush.phar \
  30. -L -o /usr/local/bin/drush && \
  31. chmod +x /usr/local/bin/drush
  32. RUN apt-get install -y rsyslog
  33. COPY ./rsyslog-drupal.conf /etc/rsyslog.d/drupal.conf
  34. # ENTRYPOINT ["sh", "-c", "service rsyslog start ; tail -f /dev/null"]
  35. COPY ./php-custom.ini /usr/local/etc/php/conf.d/php-custom.ini
  36. # COPY ./php-fpm-custom.conf /usr/local/etc/php-fpm.d/php-fpm-custom.conf
  37. # COPY ./bashrc /root/.bashrc
  38. # COPY ./inputrc /root/.inputrc
  39. ARG USER_UID
  40. ARG USER_UNAME
  41. ARG USER_GID
  42. ARG USER_GNAME
  43. RUN if getent group ${USER_GNAME} ; then groupdel ${USER_GNAME}; fi &&\
  44. groupadd -g ${USER_GID} ${USER_GNAME} &&\
  45. useradd -l -u ${USER_UID} -g ${USER_GNAME} ${USER_UNAME} &&\
  46. install -d -m 0755 -o ${USER_UNAME} -g ${USER_GNAME} /home/${USER_UNAME} &&\
  47. chown --changes --silent --no-dereference --recursive \
  48. --from=33:33 ${USER_UID}:${USER_GID} \
  49. /home/${USER_UNAME}
  50. # /.composer \
  51. # /var/run/php-fpm \
  52. # /var/lib/php/sessions \
  53. COPY ./bashrc /home/${USER_UNAME}/.bashrc
  54. COPY ./inputrc /home/${USER_UNAME}/.inputrc
  55. USER ${USER_UNAME}