Dockerfile-71 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  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. #####################################
  55. # PHP REDIS EXTENSION FOR PHP 7
  56. #####################################
  57. ARG INSTALL_PHPREDIS=false
  58. RUN if [ ${INSTALL_PHPREDIS} = true ]; then \
  59. # Install Php Redis Extension
  60. pecl install -o -f redis \
  61. && rm -rf /tmp/pear \
  62. && docker-php-ext-enable redis \
  63. ;fi
  64. # Copy xdebug configration for remote debugging
  65. COPY ./xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini
  66. #####################################
  67. # MongoDB:
  68. #####################################
  69. ARG INSTALL_MONGO=false
  70. RUN if [ ${INSTALL_MONGO} = true ]; then \
  71. # Install the mongodb extension
  72. pecl install mongodb && \
  73. docker-php-ext-enable mongodb \
  74. ;fi
  75. #####################################
  76. # ZipArchive:
  77. #####################################
  78. ARG INSTALL_ZIP_ARCHIVE=false
  79. RUN if [ ${INSTALL_ZIP_ARCHIVE} = true ]; then \
  80. # Install the zip extension
  81. docker-php-ext-install zip \
  82. ;fi
  83. #####################################
  84. # bcmath:
  85. #####################################
  86. ARG INSTALL_BCMATH=false
  87. RUN if [ ${INSTALL_BCMATH} = true ]; then \
  88. # Install the bcmath extension
  89. docker-php-ext-install bcmath \
  90. ;fi
  91. #####################################
  92. # PHP Memcached:
  93. #####################################
  94. ARG INSTALL_MEMCACHED=false
  95. RUN if [ ${INSTALL_MEMCACHED} = true ]; then \
  96. # Install the php memcached extension
  97. curl -L -o /tmp/memcached.tar.gz "https://github.com/php-memcached-dev/php-memcached/archive/php7.tar.gz" \
  98. && mkdir -p memcached \
  99. && tar -C memcached -zxvf /tmp/memcached.tar.gz --strip 1 \
  100. && ( \
  101. cd memcached \
  102. && phpize \
  103. && ./configure \
  104. && make -j$(nproc) \
  105. && make install \
  106. ) \
  107. && rm -r memcached \
  108. && rm /tmp/memcached.tar.gz \
  109. && docker-php-ext-enable memcached \
  110. ;fi
  111. #####################################
  112. # Exif:
  113. #####################################
  114. ARG INSTALL_EXIF=false
  115. RUN if [ ${INSTALL_EXIF} = true ]; then \
  116. # Enable Exif PHP extentions requirements
  117. docker-php-ext-install exif \
  118. ;fi
  119. #####################################
  120. # PHP Aerospike:
  121. #####################################
  122. ARG INSTALL_AEROSPIKE_EXTENSION=false
  123. ENV INSTALL_AEROSPIKE_EXTENSION ${INSTALL_AEROSPIKE_EXTENSION}
  124. # Copy aerospike configration for remote debugging
  125. COPY ./aerospike.ini /usr/local/etc/php/conf.d/aerospike.ini
  126. RUN if [ ${INSTALL_AEROSPIKE_EXTENSION} = true ]; then \
  127. # Install the php aerospike extension
  128. curl -L -o /tmp/aerospike-client-php.tar.gz "https://github.com/luciano-jr/aerospike-client-php/archive/master.tar.gz" \
  129. && mkdir -p aerospike-client-php \
  130. && tar -C aerospike-client-php -zxvf /tmp/aerospike-client-php.tar.gz --strip 1 \
  131. && ( \
  132. cd aerospike-client-php/src/aerospike \
  133. && phpize \
  134. && ./build.sh \
  135. && make install \
  136. ) \
  137. && rm /tmp/aerospike-client-php.tar.gz \
  138. && docker-php-ext-enable aerospike \
  139. ;fi
  140. #####################################
  141. # Opcache:
  142. #####################################
  143. ARG INSTALL_OPCACHE=false
  144. RUN if [ ${INSTALL_OPCACHE} = true ]; then \
  145. docker-php-ext-install opcache \
  146. ;fi
  147. # Copy opcache configration
  148. COPY ./opcache.ini /usr/local/etc/php/conf.d/opcache.ini
  149. #####################################
  150. # Mysqli Modifications:
  151. #####################################
  152. ARG INSTALL_MYSQLI=false
  153. RUN if [ ${INSTALL_MYSQLI} = true ]; then \
  154. docker-php-ext-install mysqli \
  155. ;fi
  156. #####################################
  157. # Tokenizer Modifications:
  158. #####################################
  159. ARG INSTALL_TOKENIZER=false
  160. RUN if [ ${INSTALL_TOKENIZER} = true ]; then \
  161. docker-php-ext-install tokenizer \
  162. ;fi
  163. #####################################
  164. # Human Language and Character Encoding Support:
  165. #####################################
  166. ARG INSTALL_INTL=false
  167. RUN if [ ${INSTALL_INTL} = true ]; then \
  168. # Install intl and requirements
  169. apt-get install -y zlib1g-dev libicu-dev g++ && \
  170. docker-php-ext-configure intl && \
  171. docker-php-ext-install intl \
  172. ;fi
  173. #####################################
  174. # GHOSTSCRIPT:
  175. #####################################
  176. ARG INSTALL_GHOSTSCRIPT=false
  177. RUN if [ ${GHOSTSCRIPT} = true ]; then \
  178. # Install the ghostscript extension
  179. # for PDF editing
  180. apt-get -y update \
  181. && apt-get install -y \
  182. poppler-utils \
  183. ghostscript \
  184. ;fi
  185. #
  186. #--------------------------------------------------------------------------
  187. # Final Touch
  188. #--------------------------------------------------------------------------
  189. #
  190. ADD ./laravel.ini /usr/local/etc/php/conf.d
  191. ADD ./laravel.pool.conf /usr/local/etc/php-fpm.d/
  192. RUN rm -r /var/lib/apt/lists/*
  193. RUN usermod -u 1000 www-data
  194. WORKDIR /var/www
  195. CMD ["php-fpm"]
  196. EXPOSE 9000