Dockerfile-71 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  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.1--1.3
  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 php-soap && \
  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. docker-php-ext-install zip \
  72. ;fi
  73. #####################################
  74. # bcmath:
  75. #####################################
  76. ARG INSTALL_BCMATH=false
  77. RUN if [ ${INSTALL_BCMATH} = true ]; then \
  78. # Install the bcmath extension
  79. docker-php-ext-install bcmath \
  80. ;fi
  81. #####################################
  82. # PHP Memcached:
  83. #####################################
  84. ARG INSTALL_MEMCACHED=false
  85. RUN if [ ${INSTALL_MEMCACHED} = true ]; then \
  86. # Install the php memcached extension
  87. curl -L -o /tmp/memcached.tar.gz "https://github.com/php-memcached-dev/php-memcached/archive/php7.tar.gz" \
  88. && mkdir -p memcached \
  89. && tar -C memcached -zxvf /tmp/memcached.tar.gz --strip 1 \
  90. && ( \
  91. cd memcached \
  92. && phpize \
  93. && ./configure \
  94. && make -j$(nproc) \
  95. && make install \
  96. ) \
  97. && rm -r memcached \
  98. && rm /tmp/memcached.tar.gz \
  99. && docker-php-ext-enable memcached \
  100. ;fi
  101. #####################################
  102. # PHP Aerospike:
  103. #####################################
  104. ARG INSTALL_AEROSPIKE_EXTENSION=false
  105. ENV INSTALL_AEROSPIKE_EXTENSION ${INSTALL_AEROSPIKE_EXTENSION}
  106. # Copy aerospike configration for remote debugging
  107. COPY ./aerospike.ini /usr/local/etc/php/conf.d/aerospike.ini
  108. RUN if [ ${INSTALL_AEROSPIKE_EXTENSION} = true ]; then \
  109. # Install the php aerospike extension
  110. curl -L -o /tmp/aerospike-client-php.tar.gz "https://github.com/luciano-jr/aerospike-client-php/archive/master.tar.gz" \
  111. && mkdir -p aerospike-client-php \
  112. && tar -C aerospike-client-php -zxvf /tmp/aerospike-client-php.tar.gz --strip 1 \
  113. && ( \
  114. cd aerospike-client-php/src/aerospike \
  115. && phpize \
  116. && ./build.sh \
  117. && make install \
  118. ) \
  119. && rm /tmp/aerospike-client-php.tar.gz \
  120. ;fi
  121. #####################################
  122. # Opcache:
  123. #####################################
  124. ARG INSTALL_OPCACHE=false
  125. RUN if [ ${INSTALL_OPCACHE} = true ]; then \
  126. docker-php-ext-install opcache && \
  127. docker-php-ext-enable opcache \
  128. ;fi
  129. # Copy opcache configration
  130. COPY ./opcache.ini /usr/local/etc/php/conf.d/opcache.ini
  131. #####################################
  132. # Mysqli Modifications:
  133. #####################################
  134. ARG INSTALL_MYSQLI=false
  135. RUN if [ ${INSTALL_MYSQLI} = true ]; then \
  136. docker-php-ext-install mysqli \
  137. ;fi
  138. #####################################
  139. # Tokenizer Modifications:
  140. #####################################
  141. ARG INSTALL_TOKENIZER=false
  142. RUN if [ ${INSTALL_TOKENIZER} = true ]; then \
  143. docker-php-ext-install tokenizer \
  144. ;fi
  145. #####################################
  146. # Human Language and Character Encoding Support:
  147. #####################################
  148. ARG INTL=false
  149. RUN if [ ${INTL} = true ]; then \
  150. # Install intl and requirements
  151. apt-get install -y zlib1g-dev libicu-dev g++ && \
  152. docker-php-ext-configure intl && \
  153. docker-php-ext-install intl \
  154. ;fi
  155. #####################################
  156. # GHOSTSCRIPT:
  157. #####################################
  158. ARG GHOSTSCRIPT=false
  159. RUN if [ ${GHOSTSCRIPT} = true ]; then \
  160. # Install the ghostscript extension
  161. # for PDF editing
  162. apt-get -y update \
  163. && apt-get install -y \
  164. poppler-utils \
  165. ghostscript \
  166. ;fi
  167. #
  168. #--------------------------------------------------------------------------
  169. # Final Touch
  170. #--------------------------------------------------------------------------
  171. #
  172. ADD ./laravel.ini /usr/local/etc/php/conf.d
  173. ADD ./laravel.pool.conf /usr/local/etc/php-fpm.d/
  174. RUN rm -r /var/lib/apt/lists/*
  175. RUN usermod -u 1000 www-data
  176. WORKDIR /var/www
  177. CMD ["php-fpm"]
  178. EXPOSE 9000