<commit_before>#
# PHP Dockerfile
# 满足laravel5.1版本的基本要求
#
# https://github.com/ibbd/dockerfile-php-fpm
#
# 下载相关资源：./download.sh
# sudo docker build -t ibbd/php ./
#

# Pull base image.
#FROM php:5.6
FROM php:5.6-fpm

# sources.list
# git clone <EMAIL>:IBBD/docker-compose.git
ADD ext/sources.list   /etc/apt/sources.list

# Install modules
RUN apt-get update && apt-get install -y \
        libmcrypt-dev \
        libfreetype6-dev \
        libjpeg62-turbo-dev \
        libpng12-dev \
        libssl-dev \
    && rm -r /var/lib/apt/lists/*

# install php modules
RUN  docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
    && docker-php-ext-install gd \
    && docker-php-ext-install iconv mcrypt pdo tokenizer mbstring

# PHP config
ADD conf/php.ini        /usr/local/etc/php/php.ini
ADD conf/php-fpm.conf   /usr/local/etc/php-fpm.conf

# pecl install php modules
RUN  mkdir /home/php
COPY ext/redis.tgz    /home/php/redis.tgz 
COPY ext/mongo.tgz    /home/php/mongo.tgz 
COPY ext/msgpack.tgz  /home/php/msgpack.tgz 

# 安装mongo扩展时，出现如下错误：
# Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20131226/mongo.so'
# 需要先安装libssl-dev
RUN cd /home/php \
    && pecl install redis.tgz \
    && echo "extension=redis.so" > /usr/local/etc/php/conf.d/redis.ini \
    && pecl install msgpack.tgz \
    && echo "extension=msgpack.so" > /usr/local/etc/php/conf.d/msgpack.ini \
    && pecl install mongo.tgz \
    && echo "extension=mongo.so" > /usr/local/etc/php/conf.d/mongo.ini \
    #&& pecl install swoole \
    #&& echo "extension=swoole.so" > /usr/local/etc/php/conf.d/swoole.ini \
    && rm -rf /home/php

# composer 
#RUN curl -sS https://getcomposer.org/installer | php \
    #&& mv composer.phar /usr/local/bin/composer \
    #&& chmod 755 /usr/local/bin/composer
# composer中国镜像
#RUN composer config -g repositories.packagist composer http://packagist.phpcomposer.com

WORKDIR /var/www 

# 解决时区问题
env TZ "Asia/Shanghai"

# Define mountable directories.
VOLUME /var/www

EXPOSE 9000
#CMD ["php-fpm"]
<commit_msg>composer<commit_after>#
# PHP Dockerfile
# 满足laravel5.1版本的基本要求
#
# https://github.com/ibbd/dockerfile-php-fpm
#
# 下载相关资源：./download.sh
# sudo docker build -t ibbd/php ./
#

# Pull base image.
#FROM php:5.6
FROM php:5.6-fpm

# sources.list
# git clone <EMAIL>.com:IBBD/docker-compose.git
ADD ext/sources.list   /etc/apt/sources.list

# Install modules
RUN apt-get update && apt-get install -y \
        libmcrypt-dev \
        libfreetype6-dev \
        libjpeg62-turbo-dev \
        libpng12-dev \
        libssl-dev \
    && rm -r /var/lib/apt/lists/*

# install php modules
RUN  docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
    && docker-php-ext-install gd \
    && docker-php-ext-install iconv mcrypt pdo tokenizer mbstring

# PHP config
ADD conf/php.ini        /usr/local/etc/php/php.ini
ADD conf/php-fpm.conf   /usr/local/etc/php-fpm.conf

# pecl install php modules
RUN  mkdir /home/php
COPY ext/redis.tgz    /home/php/redis.tgz 
COPY ext/mongo.tgz    /home/php/mongo.tgz 
COPY ext/msgpack.tgz  /home/php/msgpack.tgz 

# 安装mongo扩展时，出现如下错误：
# Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20131226/mongo.so'
# 需要先安装libssl-dev
RUN cd /home/php \
    && pecl install redis.tgz \
    && echo "extension=redis.so" > /usr/local/etc/php/conf.d/redis.ini \
    && pecl install msgpack.tgz \
    && echo "extension=msgpack.so" > /usr/local/etc/php/conf.d/msgpack.ini \
    && pecl install mongo.tgz \
    && echo "extension=mongo.so" > /usr/local/etc/php/conf.d/mongo.ini \
    #&& pecl install swoole \
    #&& echo "extension=swoole.so" > /usr/local/etc/php/conf.d/swoole.ini \
    && rm -rf /home/php

# composer 
RUN curl -sS https://getcomposer.org/installer | php \
    && mv composer.phar /usr/local/bin/composer \
    && chmod 755 /usr/local/bin/composer
# composer中国镜像
RUN composer config -g repositories.packagist composer http://packagist.phpcomposer.com

WORKDIR /var/www 

# 解决时区问题
env TZ "Asia/Shanghai"

# Define mountable directories.
VOLUME /var/www

EXPOSE 9000
#CMD ["php-fpm"]

{'fraction_non_alphanumeric': 0.14842434447919173, 'fraction_numerical': 0.012509020928554247, 'mean_word_length': 2.7324955116696588, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '39750', 'n_tokens_mistral': 1760, 'n_tokens_neox': 1689, 'n_words': 308}