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.

91 lines
3.3 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
  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. && git clone https://github.com/phpredis/phpredis /usr/src/php/ext/redis \
  47. && cd /usr/src/php/ext/redis && git checkout -b php7 origin/php7 \
  48. && docker-php-ext-configure redis \
  49. && git clone https://github.com/php-memcached-dev/php-memcached /usr/src/php/ext/memcached \
  50. && cd /usr/src/php/ext/memcached && git checkout -b php7 origin/php7 \
  51. && docker-php-ext-configure memcached \
  52. && docker-php-ext-configure pdo_oci --with-pdo-oci=instantclient,/opt/oracle/instantclient_12_1,12.1 \
  53. && docker-php-ext-configure pdo_dblib --with-libdir=/lib/x86_64-linux-gnu \
  54. && docker-php-ext-install \
  55. iconv \
  56. mbstring \
  57. intl \
  58. mcrypt \
  59. gd \
  60. pgsql \
  61. mysqli \
  62. pdo_pgsql \
  63. pdo_mysql \
  64. pdo_oci \
  65. pdo_dblib \
  66. soap \
  67. sockets \
  68. zip \
  69. memcached \
  70. redis \
  71. pcntl \
  72. && docker-php-ext-enable \
  73. oci8 \
  74. opcache
  75. # Install APCu and APC backward compatibility
  76. RUN pecl install apcu \
  77. && pecl install apcu_bc-1.0.3 \
  78. && docker-php-ext-enable apcu --ini-name 10-docker-php-ext-apcu.ini \
  79. && docker-php-ext-enable apc --ini-name 20-docker-php-ext-apc.ini
  80. # Clean repository
  81. RUN apt-get clean \
  82. && rm -rf /var/lib/apt/lists/*