Dockerfile-56 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  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:5.6--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. # SOAP:
  36. #####################################
  37. ARG INSTALL_SOAP=false
  38. RUN if [ ${INSTALL_SOAP} = true ]; then \
  39. # Install the soap extension
  40. apt-get -y update && \
  41. apt-get -y install libxml2-dev php-soap && \
  42. docker-php-ext-install soap \
  43. ;fi
  44. #####################################
  45. # xDebug:
  46. #####################################
  47. ARG INSTALL_XDEBUG=false
  48. RUN if [ ${INSTALL_XDEBUG} = true ]; then \
  49. # Install the xdebug extension
  50. pecl install xdebug && \
  51. docker-php-ext-enable xdebug \
  52. ;fi
  53. # Copy xdebug configration for remote debugging
  54. COPY ./xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini
  55. #####################################
  56. # MongoDB:
  57. #####################################
  58. ARG INSTALL_MONGO=false
  59. RUN if [ ${INSTALL_MONGO} = true ]; then \
  60. # Install the mongodb extension
  61. pecl install mongodb && \
  62. docker-php-ext-enable mongodb \
  63. ;fi
  64. #####################################
  65. # ZipArchive:
  66. #####################################
  67. ARG INSTALL_ZIP_ARCHIVE=false
  68. RUN if [ ${INSTALL_ZIP_ARCHIVE} = true ]; then \
  69. # Install the zip extension
  70. pecl install zip && \
  71. docker-php-ext-enable 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. pecl install memcached-2.2.0 && \
  88. docker-php-ext-enable memcached \
  89. ;fi
  90. #####################################
  91. # PHP Aerospike:
  92. #####################################
  93. ARG INSTALL_AEROSPIKE_EXTENSION=false
  94. ENV INSTALL_AEROSPIKE_EXTENSION ${INSTALL_AEROSPIKE_EXTENSION}
  95. # Copy aerospike configration for remote debugging
  96. COPY ./aerospike.ini /usr/local/etc/php/conf.d/aerospike.ini
  97. RUN if [ ${INSTALL_AEROSPIKE_EXTENSION} = true ]; then \
  98. # Install the php aerospike extension
  99. curl -L -o /tmp/aerospike-client-php.tar.gz "https://github.com/luciano-jr/aerospike-client-php/archive/master.tar.gz" \
  100. && mkdir -p aerospike-client-php \
  101. && tar -C aerospike-client-php -zxvf /tmp/aerospike-client-php.tar.gz --strip 1 \
  102. && ( \
  103. cd aerospike-client-php/src/aerospike \
  104. && phpize \
  105. && ./build.sh \
  106. && make install \
  107. ) \
  108. && rm /tmp/aerospike-client-php.tar.gz \
  109. && docker-php-ext-enable aerospike \
  110. ;fi
  111. #####################################
  112. # Opcache:
  113. #####################################
  114. ARG INSTALL_OPCACHE=false
  115. RUN if [ ${INSTALL_OPCACHE} = true ]; then \
  116. docker-php-ext-install opcache && \
  117. docker-php-ext-enable opcache \
  118. ;fi
  119. # Copy opcache configration
  120. COPY ./opcache.ini /usr/local/etc/php/conf.d/opcache.ini
  121. #####################################
  122. # Codeigniter Modifications:
  123. #####################################
  124. ARG CODEIGNITER=false
  125. RUN if [ ${CODEIGNITER} = true ]; then \
  126. # Install Codeigniter PHP extentions requirements
  127. docker-php-ext-install mysqli && \
  128. docker-php-ext-install tokenizer \
  129. ;fi
  130. #
  131. #--------------------------------------------------------------------------
  132. # Final Touch
  133. #--------------------------------------------------------------------------
  134. #
  135. ADD ./laravel.ini /usr/local/etc/php/conf.d
  136. ADD ./laravel.pool.conf /usr/local/etc/php-fpm.d/
  137. RUN rm -r /var/lib/apt/lists/*
  138. RUN usermod -u 1000 www-data
  139. WORKDIR /var/www
  140. CMD ["php-fpm"]
  141. EXPOSE 9000