Dockerfile-70 3.7 KB

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