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.

79 lines
2.7 KiB

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. ADD build/pgdg.list /etc/apt/sources.list.d/
  10. RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | \
  11. apt-key add -
  12. # Add Oracle Instantclient
  13. COPY build/instantclient-*.zip /opt/oracle/
  14. RUN unzip /opt/oracle/instantclient-basic-linux.x64-12.1.0.2.0.zip -d /opt/oracle \
  15. && unzip /opt/oracle/instantclient-sdk-linux.x64-12.1.0.2.0.zip -d /opt/oracle \
  16. && ln -s /opt/oracle/instantclient_12_1/libclntsh.so.12.1 /opt/oracle/instantclient_12_1/libclntsh.so \
  17. && ln -s /opt/oracle/instantclient_12_1/libclntshcore.so.12.1 /opt/oracle/instantclient_12_1/libclntshcore.so \
  18. && ln -s /opt/oracle/instantclient_12_1/libocci.so.12.1 /opt/oracle/instantclient_12_1/libocci.so \
  19. && rm -rf /opt/oracle/*.zip
  20. # Install PHP extensions deps
  21. RUN apt-get update && apt-get install --no-install-recommends -y \
  22. postgresql-server-dev-9.5 \
  23. libfreetype6-dev \
  24. libjpeg62-turbo-dev \
  25. libmcrypt-dev \
  26. libpng12-dev \
  27. zlib1g-dev \
  28. libicu-dev \
  29. g++ \
  30. unixodbc-dev \
  31. libxml2-dev \
  32. libaio-dev \
  33. libmemcached-dev \
  34. freetds-dev
  35. # Clean repository
  36. RUN apt-get clean \
  37. && rm -rf /var/lib/apt/lists/*
  38. # Install Composer
  39. RUN curl -sS https://getcomposer.org/installer | php -- \
  40. --install-dir=/usr/local/bin \
  41. --filename=composer
  42. # Install PHP extensions
  43. RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
  44. && echo 'instantclient,/opt/oracle/instantclient_12_1/' | pecl install oci8 \
  45. && pecl install apcu \
  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_dblib --with-libdir=/lib/x86_64-linux-gnu \
  53. && docker-php-ext-install \
  54. iconv \
  55. mbstring \
  56. intl \
  57. mcrypt \
  58. gd \
  59. pgsql \
  60. mysqli \
  61. pdo_pgsql \
  62. pdo_mysql \
  63. pdo_dblib \
  64. soap \
  65. sockets \
  66. zip \
  67. memcached \
  68. redis \
  69. pcntl \
  70. && docker-php-ext-enable \
  71. oci8 \
  72. apcu \
  73. opcache