Permalink
Fetching contributors…
Cannot retrieve contributors at this time
47 lines (40 sloc) 1.82 KB
FROM php:7.0-fpm
COPY . /code
# Install libraries and PHP-Extensions that are not provided by the base image
RUN apt-get update \
&& apt-get install -y \
libfreetype6-dev \
libjpeg62-turbo-dev \
libsnmp-dev \
snmp \
&& docker-php-ext-install -j$(nproc) mysqli snmp \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
&& docker-php-ext-install -j$(nproc) gd \
# Development extensions
&& pecl install xdebug \
&& docker-php-ext-enable xdebug \
&& echo 'xdebug.remote_enable=1' >> /usr/local/etc/php/php.ini \
&& echo 'xdebug.remote_connect_back=1' >> /usr/local/etc/php/php.ini \
# Cleanup
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean
# Composer setup starts here. The zip extension is required for that.
# See https://github.com/composer/docker/blob/8a2a40c3376bac96f8e3db2f129062173bff7734/1.6/Dockerfile
RUN docker-php-ext-install zip
ENV COMPOSER_ALLOW_SUPERUSER 1
ENV COMPOSER_HOME /tmp
ENV COMPOSER_VERSION 1.6.2
RUN curl -s -f -L -o /tmp/installer.php https://raw.githubusercontent.com/composer/getcomposer.org/b107d959a5924af895807021fcef4ffec5a76aa9/web/installer \
&& php -r " \
\$signature = '544e09ee996cdf60ece3804abc52599c22b1f40f4323403c44d44fdfdd586475ca9813a858088ffbc1f233e9b180f061'; \
\$hash = hash('SHA384', file_get_contents('/tmp/installer.php')); \
if (!hash_equals(\$signature, \$hash)) { \
unlink('/tmp/installer.php'); \
echo 'Integrity check failed, installer is either corrupt or worse.' . PHP_EOL; \
exit(1); \
}" \
&& php /tmp/installer.php --no-ansi --install-dir=/usr/bin --filename=composer --version=${COMPOSER_VERSION} \
&& composer --ansi --version --no-interaction \
&& rm -rf /tmp/* /tmp/.htaccess
WORKDIR /code
RUN composer install