Dockerfile 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. cp /usr/local/etc/php/php.ini-development /usr/local/etc/php/php.ini && \
  11. # docker-php-ext-install -j$(nproc) iconv && \
  12. docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ && \
  13. apt-get install -y imagemagick libmagickwand-dev && \
  14. pecl install imagick && docker-php-ext-enable imagick && \
  15. docker-php-ext-install -j$(nproc) gd && \
  16. docker-php-ext-install pdo_mysql zip && \
  17. docker-php-ext-install opcache && \
  18. docker-php-ext-install bcmath && \
  19. apt-get install -y git vim && \
  20. pecl install redis-4.3.0 && \
  21. pecl install xdebug-2.7.0 && \
  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 curl && \
  33. curl -sL https://deb.nodesource.com/setup_11.x | bash - && \
  34. curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
  35. echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \
  36. apt-get update && \
  37. apt-get install -y nodejs yarn
  38. RUN apt-get install -y rsyslog
  39. COPY ./rsyslog-drupal.conf /etc/rsyslog.d/drupal.conf
  40. # ENTRYPOINT ["sh", "-c", "service rsyslog start ; tail -f /dev/null"]
  41. COPY ./php-custom.ini /usr/local/etc/php/conf.d/php-custom.ini
  42. # COPY ./php-fpm-custom.conf /usr/local/etc/php-fpm.d/php-fpm-custom.conf
  43. # COPY ./bashrc /root/.bashrc
  44. # COPY ./inputrc /root/.inputrc
  45. ARG USER_UID
  46. ARG USER_UNAME
  47. ARG USER_GID
  48. ARG USER_GNAME
  49. RUN if getent group ${USER_GNAME} ; then groupdel ${USER_GNAME}; fi &&\
  50. groupadd -g ${USER_GID} ${USER_GNAME} &&\
  51. useradd -l -u ${USER_UID} -g ${USER_GNAME} ${USER_UNAME} &&\
  52. install -d -m 0755 -o ${USER_UNAME} -g ${USER_GNAME} /home/${USER_UNAME} &&\
  53. chown --changes --silent --no-dereference --recursive \
  54. --from=33:33 ${USER_UID}:${USER_GID} \
  55. /home/${USER_UNAME}
  56. # /.composer \
  57. # /var/run/php-fpm \
  58. # /var/lib/php/sessions \
  59. COPY ./bashrc /home/${USER_UNAME}/.bashrc
  60. COPY ./inputrc /home/${USER_UNAME}/.inputrc
  61. USER ${USER_UNAME}