Dockerfile 1.6 KB

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