Docker image with PHP, extensions and PHP-FPM
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

102 lines
3.4 KiB

9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
  1. FROM php:7.0-fpm
  2. # Get repository and install wget and vim
  3. RUN apt-get update && apt-get install --no-install-recommends -y \
  4. wget \
  5. vim \
  6. git \
  7. unzip
  8. # Add PostgreSQL repository
  9. RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main" > /etc/apt/sources.list.d/pgdg.list
  10. RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | \
  11. apt-key add -
  12. # Install Oracle Instantclient
  13. RUN mkdir /opt/oracle \
  14. && cd /opt/oracle \
  15. && wget https://s3.amazonaws.com/merofile/instantclient-basic-linux.x64-12.1.0.2.0.zip \
  16. && wget https://s3.amazonaws.com/merofile/instantclient-sdk-linux.x64-12.1.0.2.0.zip \
  17. && unzip /opt/oracle/instantclient-basic-linux.x64-12.1.0.2.0.zip -d /opt/oracle \
  18. && unzip /opt/oracle/instantclient-sdk-linux.x64-12.1.0.2.0.zip -d /opt/oracle \
  19. && ln -s /opt/oracle/instantclient_12_1/libclntsh.so.12.1 /opt/oracle/instantclient_12_1/libclntsh.so \
  20. && ln -s /opt/oracle/instantclient_12_1/libclntshcore.so.12.1 /opt/oracle/instantclient_12_1/libclntshcore.so \
  21. && ln -s /opt/oracle/instantclient_12_1/libocci.so.12.1 /opt/oracle/instantclient_12_1/libocci.so \
  22. && rm -rf /opt/oracle/*.zip
  23. # Install PHP extensions deps
  24. RUN apt-get update \
  25. && apt-get install --no-install-recommends -y \
  26. postgresql-server-dev-9.5 \
  27. libfreetype6-dev \
  28. libjpeg62-turbo-dev \
  29. libmcrypt-dev \
  30. libpng12-dev \
  31. zlib1g-dev \
  32. libicu-dev \
  33. g++ \
  34. unixodbc-dev \
  35. libxml2-dev \
  36. libaio-dev \
  37. libmemcached-dev \
  38. freetds-dev
  39. # Install Composer
  40. RUN curl -sS https://getcomposer.org/installer | php -- \
  41. --install-dir=/usr/local/bin \
  42. --filename=composer
  43. # Install PHP extensions
  44. RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
  45. && echo 'instantclient,/opt/oracle/instantclient_12_1/' | pecl install oci8 \
  46. && pecl install apcu \
  47. && git clone https://github.com/phpredis/phpredis /usr/src/php/ext/redis \
  48. && cd /usr/src/php/ext/redis && git checkout -b php7 origin/php7 \
  49. && docker-php-ext-configure redis \
  50. && git clone https://github.com/php-memcached-dev/php-memcached /usr/src/php/ext/memcached \
  51. && cd /usr/src/php/ext/memcached && git checkout -b php7 origin/php7 \
  52. && docker-php-ext-configure memcached \
  53. && docker-php-ext-configure pdo_oci --with-pdo-oci=instantclient,/opt/oracle/instantclient_12_1,12.1 \
  54. && docker-php-ext-configure pdo_dblib --with-libdir=/lib/x86_64-linux-gnu \
  55. && docker-php-ext-install \
  56. iconv \
  57. mbstring \
  58. intl \
  59. mcrypt \
  60. gd \
  61. pgsql \
  62. mysqli \
  63. pdo_pgsql \
  64. pdo_mysql \
  65. pdo_oci \
  66. pdo_dblib \
  67. soap \
  68. sockets \
  69. zip \
  70. memcached \
  71. redis \
  72. pcntl \
  73. && docker-php-ext-enable \
  74. oci8 \
  75. apcu \
  76. opcache
  77. # Clean repository
  78. RUN apt-get clean \
  79. && apt-get remove -y \
  80. postgresql-server-dev-9.5 \
  81. libfreetype6-dev \
  82. libjpeg62-turbo-dev \
  83. libmcrypt-dev \
  84. libpng12-dev \
  85. zlib1g-dev \
  86. libicu-dev \
  87. g++ \
  88. unixodbc-dev \
  89. libxml2-dev \
  90. libaio-dev \
  91. libmemcached-dev \
  92. freetds-dev \
  93. && apt-get autoremove -y \
  94. && rm -rf /var/lib/apt/lists/*