Dockerfile-70 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. #
  2. #--------------------------------------------------------------------------
  3. # Image Setup
  4. #--------------------------------------------------------------------------
  5. #
  6. # To edit the 'php-fpm' base Image, visit its repository on Github
  7. # https://github.com/LaraDock/php-fpm
  8. #
  9. # To change its version, see the available Tags on the Docker Hub:
  10. # https://hub.docker.com/r/laradock/php-fpm/tags/
  11. #
  12. FROM laradock/php-fpm:7.0--1.2
  13. MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>
  14. #
  15. #--------------------------------------------------------------------------
  16. # Mandatory Software's Installation
  17. #--------------------------------------------------------------------------
  18. #
  19. # Mandatory Software's such as ("mcrypt", "pdo_mysql", "libssl-dev", ....)
  20. # are installed on the base image 'laradock/php-fpm' image. If you want
  21. # to add more Software's or remove existing one, you need to edit the
  22. # base image (https://github.com/LaraDock/php-fpm).
  23. #
  24. #
  25. #--------------------------------------------------------------------------
  26. # Optional Software's Installation
  27. #--------------------------------------------------------------------------
  28. #
  29. # Optional Software's will only be installed if you set them to `true`
  30. # in the `docker-compose.yml` before the build.
  31. # Example:
  32. # - INSTALL_ZIP_ARCHIVE=true
  33. # - ...
  34. #
  35. #####################################
  36. # SOAP:
  37. #####################################
  38. ARG INSTALL_SOAP=false
  39. RUN if [ ${INSTALL_SOAP} = true ]; then \
  40. # Install the soap extension
  41. apt-get -y update && \
  42. apt-get -y install libxml2-dev && \
  43. docker-php-ext-install soap \
  44. ;fi
  45. #####################################
  46. # xDebug:
  47. #####################################
  48. ARG INSTALL_XDEBUG=false
  49. RUN if [ ${INSTALL_XDEBUG} = true ]; then \
  50. # Install the xdebug extension
  51. pecl install xdebug && \
  52. docker-php-ext-enable xdebug \
  53. ;fi
  54. # Copy xdebug configration for remote debugging
  55. COPY ./xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini
  56. #####################################
  57. # MongoDB:
  58. #####################################
  59. ARG INSTALL_MONGO=false
  60. RUN if [ ${INSTALL_MONGO} = true ]; then \
  61. # Install the mongodb extension
  62. pecl install mongodb && \
  63. docker-php-ext-enable mongodb \
  64. ;fi
  65. #####################################
  66. # ZipArchive:
  67. #####################################
  68. ARG INSTALL_ZIP_ARCHIVE=false
  69. RUN if [ ${INSTALL_ZIP_ARCHIVE} = true ]; then \
  70. # Install the zip extension
  71. pecl install zip && \
  72. docker-php-ext-enable zip \
  73. ;fi
  74. #####################################
  75. # bcmath:
  76. #####################################
  77. ARG INSTALL_BCMATH=false
  78. RUN if [ ${INSTALL_BCMATH} = true ]; then \
  79. # Install the bcmath extension
  80. docker-php-ext-install bcmath \
  81. ;fi
  82. #####################################
  83. # PHP Memcached:
  84. #####################################
  85. ARG INSTALL_MEMCACHED=false
  86. RUN if [ ${INSTALL_MEMCACHED} = true ]; then \
  87. # Install the php memcached extension
  88. curl -L -o /tmp/memcached.tar.gz "https://github.com/php-memcached-dev/php-memcached/archive/php7.tar.gz" \
  89. && mkdir -p memcached \
  90. && tar -C memcached -zxvf /tmp/memcached.tar.gz --strip 1 \
  91. && ( \
  92. cd memcached \
  93. && phpize \
  94. && ./configure \
  95. && make -j$(nproc) \
  96. && make install \
  97. ) \
  98. && rm -r memcached \
  99. && rm /tmp/memcached.tar.gz \
  100. && docker-php-ext-enable memcached \
  101. ;fi
  102. #####################################
  103. # PHP Aerospike:
  104. #####################################
  105. ARG INSTALL_AEROSPIKE_EXTENSION=false
  106. ENV INSTALL_AEROSPIKE_EXTENSION ${INSTALL_AEROSPIKE_EXTENSION}
  107. # Copy aerospike configration for remote debugging
  108. COPY ./aerospike.ini /usr/local/etc/php/conf.d/aerospike.ini
  109. RUN if [ ${INSTALL_AEROSPIKE_EXTENSION} = true ]; then \
  110. # Install the php aerospike extension
  111. curl -L -o /tmp/aerospike-client-php.tar.gz "https://github.com/luciano-jr/aerospike-client-php/archive/master.tar.gz" \
  112. && mkdir -p aerospike-client-php \
  113. && tar -C aerospike-client-php -zxvf /tmp/aerospike-client-php.tar.gz --strip 1 \
  114. && ( \
  115. cd aerospike-client-php/src/aerospike \
  116. && phpize \
  117. && ./build.sh \
  118. && make install \
  119. ) \
  120. && rm /tmp/aerospike-client-php.tar.gz \
  121. ;fi
  122. #####################################
  123. # Opcache:
  124. #####################################
  125. ARG INSTALL_OPCACHE=false
  126. RUN if [ ${INSTALL_OPCACHE} = true ]; then \
  127. docker-php-ext-install opcache && \
  128. docker-php-ext-enable opcache \
  129. ;fi
  130. # Copy opcache configration
  131. COPY ./opcache.ini /usr/local/etc/php/conf.d/opcache.ini
  132. #####################################
  133. # Codeigniter Modifications:
  134. #####################################
  135. ARG CODEIGNITER=false
  136. RUN if [ ${CODEIGNITER} = true ]; then \
  137. # Install Codeigniter PHP extentions requirements
  138. docker-php-ext-install mysqli && \
  139. docker-php-ext-install tokenizer \
  140. ;fi
  141. #
  142. #--------------------------------------------------------------------------
  143. # Final Touch
  144. #--------------------------------------------------------------------------
  145. #
  146. ADD ./laravel.ini /usr/local/etc/php/conf.d
  147. ADD ./laravel.pool.conf /usr/local/etc/php-fpm.d/
  148. RUN rm -r /var/lib/apt/lists/*
  149. RUN usermod -u 1000 www-data
  150. WORKDIR /var/www
  151. CMD ["php-fpm"]
  152. EXPOSE 9000