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.

75 lines
2.5 KiB

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/php-memcached-dev/php-memcached /usr/src/php/ext/memcached \
  47. && cd /usr/src/php/ext/memcached && git checkout -b php7 origin/php7 \
  48. && docker-php-ext-configure memcached \
  49. && docker-php-ext-configure pdo_dblib --with-libdir=/lib/x86_64-linux-gnu \
  50. && docker-php-ext-install \
  51. iconv \
  52. mbstring \
  53. intl \
  54. mcrypt \
  55. gd \
  56. pgsql \
  57. mysqli \
  58. pdo_pgsql \
  59. pdo_mysql \
  60. pdo_dblib \
  61. soap \
  62. sockets \
  63. zip \
  64. memcached \
  65. pcntl \
  66. && docker-php-ext-enable \
  67. oci8 \
  68. apcu \
  69. opcache