Created
February 8, 2017 11:21
-
-
Save sammyd/7f467d585e2ac103b13dd04b429c87b2 to your computer and use it in GitHub Desktop.
WIP PHP Dockerfile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM php:5.6-fpm | |
MAINTAINER Sam Davies <[email protected]> | |
# Add the required PHP extensions | |
RUN set -ex \ | |
&& apt-get update \ | |
&& apt-get install -y libjpeg-dev libpng12-dev git wget --no-install-recommends \ | |
&& rm -r /var/lib/apt/lists/* \ | |
&& echo '' | pecl install apcu-4.0.11 redis \ | |
&& docker-php-ext-enable apcu redis \ | |
&& docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \ | |
&& docker-php-ext-install gd mysqli opcache pdo_mysql | |
# Install tideways extension | |
RUN git clone https://github.com/tideways/php-profiler-extension /usr/src/php/ext/tideways \ | |
&& wget https://github.com/tideways/profiler/releases/download/v2.0.14/Tideways.php \ | |
&& mv Tideways.php /usr/local/lib/php/extensions/no-debug-non-zts-20131226 \ | |
&& docker-php-ext-configure /usr/src/php/ext/tideways \ | |
&& docker-php-ext-install /usr/src/php/ext/tideways | |
# set recommended PHP.ini settings | |
# see https://secure.php.net/manual/en/opcache.installation.php | |
RUN { \ | |
echo 'opcache.memory_consumption=128'; \ | |
echo 'opcache.interned_strings_buffer=8'; \ | |
echo 'opcache.max_accelerated_files=4000'; \ | |
echo 'opcache.revalidate_freq=2'; \ | |
echo 'opcache.fast_shutdown=1'; \ | |
echo 'opcache.enable_cli=1'; \ | |
} > /usr/local/etc/php/conf.d/opcache-recommended.ini | |
# Configure the main working directory. This is the base | |
# directory used in any further RUN, COPY, and ENTRYPOINT | |
# commands. | |
RUN mkdir -p /var/www/koenig | |
WORKDIR /var/www/koenig | |
# Install WP-CLI | |
RUN curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar && chmod +x wp-cli.phar && mv wp-cli.phar /usr/bin/wp-cli | |
# Add the config file | |
ADD ./docker/usr/local/etc/php/php.ini /usr/local/etc/php/php.ini | |
# Finally, add all the source code | |
COPY . ./ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
[tideways] | |
tideways.udp_connection="tideways:8135" | |
tideways.connection="tcp://tideways:9135" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment