Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Bash
Posted by: Сергей Шевченко
Added: Dec 10, 2019 4:35 PM
Modified: Mar 31, 2020 2:41 PM
Views: 123
  1. FROM php:7.3-fpm
  2.  
  3. MAINTAINER Sergey Shevchenko <sergey.leonidovich.shevchenko@gmail.com>
  4.  
  5. ARG APPLICATION_PATH
  6. ARG APP_ENV
  7. ARG NETWORK_SUBNET
  8. ARG NGINX_HOST_HTTP_PORT
  9. ARG NGINX_HOST_HTTPS_PORT
  10. ARG MYSQL_USER
  11. ARG MYSQL_PASSWORD
  12. ARG MYSQL_ROOT_PASSWORD
  13. ARG MYSQL_DATABASE
  14. ARG MAILER_TRANSPORT
  15. ARG MAILER_HOST
  16. ARG MAILER_PORT
  17. ARG MAILER_USER
  18. ARG MAILER_PASSWORD
  19. ARG RUN_TEST_AFTER_INSTALL_PROJECT
  20.  
  21. ENV APPLICATION_PATH ${APPLICATION_PATH}
  22. ENV APP_ENV ${APP_ENV}
  23. ENV NETWORK_SUBNET ${NETWORK_SUBNET}
  24. ENV NGINX_HOST_HTTP_PORT ${NGINX_HOST_HTTP_PORT}
  25. ENV NGINX_HOST_HTTPS_PORT ${NGINX_HOST_HTTPS_PORT}
  26. ENV MYSQL_USER ${MYSQL_USER}
  27. ENV MYSQL_PASSWORD ${MYSQL_PASSWORD}
  28. ENV MYSQL_ROOT_PASSWORD ${MYSQL_ROOT_PASSWORD}
  29. ENV MYSQL_DATABASE ${MYSQL_DATABASE}
  30. ENV MAILER_TRANSPORT ${MAILER_TRANSPORT}
  31. ENV MAILER_HOST ${MAILER_HOST}
  32. ENV MAILER_PORT ${MAILER_PORT}
  33. ENV MAILER_USER ${MAILER_USER}
  34. ENV MAILER_PASSWORD ${MAILER_PASSWORD}
  35. ENV RUN_TEST_AFTER_INSTALL_PROJECT ${RUN_TEST_AFTER_INSTALL_PROJECT}
  36.  
  37. # Ставим все необходимые для работы пакеты
  38. RUN apt-get update     \
  39.     && apt-get install -y \
  40.             curl          \
  41.             git           \
  42.             less          \
  43.             vim           \
  44.             zlib1g-dev    \
  45.             zip
  46.  
  47. # Устанавливаем php-расширения
  48. RUN docker-php-ext-install -j$(nproc) \
  49.     bcmath                            \
  50.     pdo_mysql
  51.  
  52. RUN pecl install \
  53.     grpc         \
  54.     xdebug
  55.  
  56. # Копируем php-конфигурацию внутрь контейнера
  57. COPY ./build/development/php-fpm/conf.d/* /usr/local/etc/php/conf.d/
  58. COPY ./build/development/php-fpm/php.ini /usr/local/etc/php/php.ini
  59.  
  60. # Включаем расширения
  61. RUN docker-php-ext-enable \
  62.     grpc \
  63.     xdebug
  64.  
  65. # Устанавливаем composer
  66. RUN curl -sS https://getcomposer.org/installer                \
  67.     | php -- --install-dir=/usr/local/bin --filename=composer
  68.  
  69. # Устанавливаем рабочую дирректорию
  70. WORKDIR ${APPLICATION_PATH}
  71.  
  72. # Entrypoint
  73. COPY ./build/development/php-fpm/entrypoint.sh /entrypoint.sh
  74. RUN chmod +x /entrypoint.sh
  75. ENTRYPOINT ["/entrypoint.sh"]
  76.  
  77. EXPOSE 9000
  78.  
  79. CMD ["php-fpm", "-F"]
  80.