Dockerfile-70 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  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 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.0
  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. pecl install zip && \
  82. docker-php-ext-enable zip \
  83. ;fi
  84. #####################################
  85. # bcmath:
  86. #####################################
  87. ARG INSTALL_BCMATH=false
  88. RUN if [ ${INSTALL_BCMATH} = true ]; then \
  89. # Install the bcmath extension
  90. docker-php-ext-install bcmath \
  91. ;fi
  92. #####################################
  93. # PHP Memcached:
  94. #####################################
  95. ARG INSTALL_MEMCACHED=false
  96. RUN if [ ${INSTALL_MEMCACHED} = true ]; then \
  97. # Install the php memcached extension
  98. curl -L -o /tmp/memcached.tar.gz "https://github.com/php-memcached-dev/php-memcached/archive/php7.tar.gz" \
  99. && mkdir -p memcached \
  100. && tar -C memcached -zxvf /tmp/memcached.tar.gz --strip 1 \
  101. && ( \
  102. cd memcached \
  103. && phpize \
  104. && ./configure \
  105. && make -j$(nproc) \
  106. && make install \
  107. ) \
  108. && rm -r memcached \
  109. && rm /tmp/memcached.tar.gz \
  110. && docker-php-ext-enable memcached \
  111. ;fi
  112. #####################################
  113. # Exif:
  114. #####################################
  115. ARG INSTALL_EXIF=false
  116. RUN if [ ${INSTALL_EXIF} = true ]; then \
  117. # Enable Exif PHP extentions requirements
  118. docker-php-ext-install exif && \
  119. docker-php-ext-enable exif \
  120. ;fi
  121. #####################################
  122. # PHP Aerospike:
  123. #####################################
  124. ARG INSTALL_AEROSPIKE_EXTENSION=false
  125. ENV INSTALL_AEROSPIKE_EXTENSION ${INSTALL_AEROSPIKE_EXTENSION}
  126. # Copy aerospike configration for remote debugging
  127. COPY ./aerospike.ini /usr/local/etc/php/conf.d/aerospike.ini
  128. RUN if [ ${INSTALL_AEROSPIKE_EXTENSION} = true ]; then \
  129. # Install the php aerospike extension
  130. curl -L -o /tmp/aerospike-client-php.tar.gz "https://github.com/luciano-jr/aerospike-client-php/archive/master.tar.gz" \
  131. && mkdir -p aerospike-client-php \
  132. && tar -C aerospike-client-php -zxvf /tmp/aerospike-client-php.tar.gz --strip 1 \
  133. && ( \
  134. cd aerospike-client-php/src/aerospike \
  135. && phpize \
  136. && ./build.sh \
  137. && make install \
  138. ) \
  139. && rm /tmp/aerospike-client-php.tar.gz \
  140. && docker-php-ext-enable aerospike \
  141. ;fi
  142. #####################################
  143. # Opcache:
  144. #####################################
  145. ARG INSTALL_OPCACHE=false
  146. RUN if [ ${INSTALL_OPCACHE} = true ]; then \
  147. docker-php-ext-install opcache && \
  148. docker-php-ext-enable opcache \
  149. ;fi
  150. # Copy opcache configration
  151. COPY ./opcache.ini /usr/local/etc/php/conf.d/opcache.ini
  152. #####################################
  153. # Codeigniter Modifications:
  154. #####################################
  155. ARG CODEIGNITER=false
  156. RUN if [ ${CODEIGNITER} = true ]; then \
  157. # Install Codeigniter PHP extentions requirements
  158. docker-php-ext-install mysqli && \
  159. docker-php-ext-install tokenizer \
  160. ;fi
  161. #
  162. #--------------------------------------------------------------------------
  163. # Final Touch
  164. #--------------------------------------------------------------------------
  165. #
  166. ADD ./laravel.ini /usr/local/etc/php/conf.d
  167. ADD ./laravel.pool.conf /usr/local/etc/php-fpm.d/
  168. RUN rm -r /var/lib/apt/lists/*
  169. RUN usermod -u 1000 www-data
  170. WORKDIR /var/www
  171. CMD ["php-fpm"]
  172. EXPOSE 9000