Dockerfile-php71 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. FROM php:7.1-alpine
  2. ENV SRC_DIR /usr/src/gaufrette
  3. RUN apk add --no-cache --virtual .persistent-deps \
  4. git \
  5. zlib
  6. # PHP extensions
  7. ENV MONGODB_VERSION="1.2.11" \
  8. SSH2_VERSION="1.1.2"
  9. RUN set -xe \
  10. && apk add --no-cache --virtual .build-deps \
  11. $PHPIZE_DEPS \
  12. libssh2-dev \
  13. zlib-dev \
  14. && docker-php-ext-install \
  15. zip \
  16. && pecl install \
  17. mongodb-${MONGODB_VERSION} \
  18. ssh2-${SSH2_VERSION} \
  19. && docker-php-ext-enable --ini-name 05-opcache.ini opcache \
  20. && docker-php-ext-enable \
  21. mongodb \
  22. ssh2 \
  23. && apk del .build-deps
  24. COPY docker/php.ini /usr/local/etc/php/php.ini
  25. COPY docker/install-composer.sh /usr/local/bin/install-composer
  26. RUN chmod +x /usr/local/bin/install-composer
  27. RUN set -xe \
  28. && install-composer \
  29. && mv composer.phar /usr/local/bin/composer
  30. ENV COMPOSER_ALLOW_SUPERUSER 1
  31. RUN composer global require "hirak/prestissimo" --prefer-dist --no-progress --no-suggest --optimize-autoloader --apcu-autoloader \
  32. && composer clear-cache
  33. WORKDIR ${SRC_DIR}
  34. COPY composer.json ./
  35. RUN composer update --prefer-dist --no-autoloader --no-scripts --no-progress --no-suggest \
  36. && composer clear-cache
  37. COPY spec spec/
  38. COPY src src/
  39. COPY tests tests/
  40. COPY bin/tests bin/tests
  41. RUN composer dump-autoload
  42. CMD ["bin/tests"]