Dockerfile 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. mysql-client \
  8. zip \
  9. libzip-dev && \
  10. # docker-php-ext-install -j$(nproc) iconv && \
  11. docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ && \
  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. apt-get install -y git vim && \
  19. pecl install redis-4.3.0 && \
  20. pecl install xdebug-2.7.0 && \
  21. docker-php-ext-enable redis xdebug
  22. RUN export COMPOSER_HOME=/usr/local/composer && \
  23. curl -sS https://getcomposer.org/installer \
  24. | php -- --install-dir=/usr/local/bin --filename=composer
  25. # in this case (D7) drush launcher is not working don't know why.
  26. # Replaced by an alias of drush installed with composer
  27. # https://www.drupal.org/node/1302418#comment-10710726
  28. # curl https://drupalconsole.com/installer \
  29. # -L -o /usr/local/bin/drupal && \
  30. # chmod +x /usr/local/bin/drupal && \
  31. # curl https://github.com/drush-ops/drush-launcher/releases/download/0.6.0/drush.phar \
  32. # -L -o /usr/local/bin/drush && \
  33. # chmod +x /usr/local/bin/drush
  34. # RUN apt-get install -y curl && \
  35. # curl -sL https://deb.nodesource.com/setup_12.x | bash - && \
  36. # curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
  37. # echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \
  38. # apt-get update && \
  39. # apt-get install -y nodejs yarn
  40. RUN apt-get install -y rsyslog
  41. COPY ./rsyslog-drupal.conf /etc/rsyslog.d/drupal.conf
  42. # ENTRYPOINT ["sh", "-c", "service rsyslog start ; tail -f /dev/null"]
  43. COPY ./php-custom.ini /usr/local/etc/php/conf.d/php-custom.ini
  44. # COPY ./php-fpm-custom.conf /usr/local/etc/php-fpm.d/php-fpm-custom.conf
  45. # COPY ./bashrc /root/.bashrc
  46. # COPY ./inputrc /root/.inputrc
  47. ARG USER_UID
  48. ARG USER_UNAME
  49. ARG USER_GID
  50. ARG USER_GNAME
  51. RUN if getent group ${USER_GNAME} ; then groupdel ${USER_GNAME}; fi &&\
  52. groupadd -g ${USER_GID} ${USER_GNAME} &&\
  53. useradd -l -u ${USER_UID} -g ${USER_GNAME} ${USER_UNAME} &&\
  54. install -d -m 0755 -o ${USER_UNAME} -g ${USER_GNAME} /home/${USER_UNAME} &&\
  55. chown --changes --silent --no-dereference --recursive \
  56. --from=33:33 ${USER_UID}:${USER_GID} \
  57. /home/${USER_UNAME}
  58. # /.composer \
  59. # /var/run/php-fpm \
  60. # /var/lib/php/sessions \
  61. COPY ./bashrc /home/${USER_UNAME}/.bashrc
  62. COPY ./inputrc /home/${USER_UNAME}/.inputrc
  63. USER ${USER_UNAME}