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.

98 lines
3.2 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. libssl-dev \
  40. openssl
  41. # Install Composer
  42. RUN curl -sS https://getcomposer.org/installer | php -- \
  43. --install-dir=/usr/local/bin \
  44. --filename=composer
  45. # Install PHP extensions
  46. RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
  47. && echo 'instantclient,/opt/oracle/instantclient_12_1/' | pecl install oci8 \
  48. && docker-php-ext-configure pdo_oci --with-pdo-oci=instantclient,/opt/oracle/instantclient_12_1,12.1 \
  49. && docker-php-ext-configure pdo_dblib --with-libdir=/lib/x86_64-linux-gnu \
  50. && pecl install sqlsrv-4.1.6.1 \
  51. && pecl install pdo_sqlsrv-4.1.6.1 \
  52. && pecl install redis \
  53. && pecl install memcached \
  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. pcntl \
  70. ftp \
  71. && docker-php-ext-enable \
  72. oci8 \
  73. sqlsrv \
  74. pdo_sqlsrv \
  75. redis \
  76. memcached \
  77. opcache
  78. # Install APCu and APC backward compatibility
  79. RUN pecl install apcu \
  80. && pecl install apcu_bc-1.0.3 \
  81. && docker-php-ext-enable apcu --ini-name 10-docker-php-ext-apcu.ini \
  82. && docker-php-ext-enable apc --ini-name 20-docker-php-ext-apc.ini
  83. # Install PHPUnit
  84. RUN wget https://phar.phpunit.de/phpunit.phar -O /usr/local/bin/phpunit \
  85. && chmod +x /usr/local/bin/phpunit
  86. # Clean repository
  87. RUN apt-get clean \
  88. && rm -rf /var/lib/apt/lists/*