Dockerfile-70 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  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. # xDebug:
  36. #####################################
  37. ARG INSTALL_XDEBUG=true
  38. ENV INSTALL_XDEBUG ${INSTALL_XDEBUG}
  39. RUN if [ ${INSTALL_XDEBUG} = true ]; then \
  40. # Install the xdebug extension
  41. pecl install xdebug && \
  42. docker-php-ext-enable xdebug \
  43. ;fi
  44. # Copy xdebug configration for remote debugging
  45. COPY ./xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini
  46. #####################################
  47. # MongoDB:
  48. #####################################
  49. ARG INSTALL_MONGO=true
  50. ENV INSTALL_MONGO ${INSTALL_MONGO}
  51. RUN if [ ${INSTALL_MONGO} = true ]; then \
  52. # Install the mongodb extension
  53. pecl install mongodb && \
  54. docker-php-ext-enable mongodb \
  55. ;fi
  56. #####################################
  57. # ZipArchive:
  58. #####################################
  59. ARG INSTALL_ZIP_ARCHIVE=true
  60. ENV INSTALL_ZIP_ARCHIVE ${INSTALL_ZIP_ARCHIVE}
  61. RUN if [ ${INSTALL_ZIP_ARCHIVE} = true ]; then \
  62. # Install the zip extension
  63. pecl install zip && \
  64. docker-php-ext-enable zip \
  65. ;fi
  66. #####################################
  67. # PHP Memcached:
  68. #####################################
  69. ARG INSTALL_MEMCACHED=true
  70. ENV INSTALL_MEMCACHED ${INSTALL_MEMCACHED}
  71. RUN if [ ${INSTALL_MEMCACHED} = true ]; then \
  72. # Install the php memcached extension
  73. curl -L -o /tmp/memcached.tar.gz "https://github.com/php-memcached-dev/php-memcached/archive/php7.tar.gz" \
  74. && mkdir -p memcached \
  75. && tar -C memcached -zxvf /tmp/memcached.tar.gz --strip 1 \
  76. && ( \
  77. cd memcached \
  78. && phpize \
  79. && ./configure \
  80. && make -j$(nproc) \
  81. && make install \
  82. ) \
  83. && rm -r memcached \
  84. && rm /tmp/memcached.tar.gz \
  85. && docker-php-ext-enable memcached \
  86. ;fi
  87. #####################################
  88. # PHP Aerospike:
  89. #####################################
  90. ARG INSTALL_AEROSPIKE_EXTENSION=true
  91. ENV INSTALL_AEROSPIKE_EXTENSION ${INSTALL_AEROSPIKE_EXTENSION}
  92. # Copy aerospike configration for remote debugging
  93. COPY ./aerospike.ini /usr/local/etc/php/conf.d/aerospike.ini
  94. RUN if [ ${INSTALL_AEROSPIKE_EXTENSION} = true ]; then \
  95. # Install the php aerospike extension
  96. curl -L -o /tmp/aerospike-client-php.tar.gz "https://github.com/luciano-jr/aerospike-client-php/archive/master.tar.gz" \
  97. && mkdir -p aerospike-client-php \
  98. && tar -C aerospike-client-php -zxvf /tmp/aerospike-client-php.tar.gz --strip 1 \
  99. && ( \
  100. cd aerospike-client-php/src/aerospike \
  101. && phpize \
  102. && ./build.sh \
  103. && make install \
  104. ) \
  105. && rm /tmp/aerospike-client-php.tar.gz \
  106. ;fi
  107. #####################################
  108. # Opcache:
  109. #####################################
  110. ARG INSTALL_OPCACHE=true
  111. ENV INSTALL_OPCACHE ${INSTALL_OPCACHE}
  112. RUN if [ ${INSTALL_OPCACHE} = true ]; then \
  113. docker-php-ext-install opcache && \
  114. docker-php-ext-enable opcache \
  115. ;fi
  116. #
  117. #--------------------------------------------------------------------------
  118. # Final Touch
  119. #--------------------------------------------------------------------------
  120. #
  121. ADD ./laravel.ini /usr/local/etc/php/conf.d
  122. ADD ./laravel.pool.conf /usr/local/etc/php-fpm.d/
  123. RUN rm -r /var/lib/apt/lists/*
  124. RUN usermod -u 1000 www-data
  125. WORKDIR /var/www/laravel
  126. CMD ["php-fpm"]
  127. EXPOSE 9000