Public Repository

Last pushed: a year ago
Short Description
PHP5 with Gearman Server, Cassandra and Memcache extensions
Full Description

############################################################

Dockerfile to build Apache, PHP7, Gearman server

Memcached and Cassandra extensions

Based on Ubuntu 16.04

############################################################

FROM ubuntu:16.04
MAINTAINER André Garcia andre.f.garcia@inesctec.pt
VOLUME ["/var/www/html/"]
RUN apt-get update
RUN apt-get install -y \
apache2 \
php7.0 \
libapache2-mod-php7.0 \
php-pear \
php7.0-fpm \
php7.0-cli \
php7.0-curl \
php7.0-gd \
php7.0-intl \
php7.0-mysql \
php7.0-dev \
libevent-2.0-5 \
libgearman-dev \
vim-nox \
gearman-job-server \
supervisor \
gearman-tools \
libmemcached-dev \
zlib1g-dev \
git \
g++ \
make \
cmake \
libuv-dev \
libssl-dev \
libgmp-dev \
openssl \
libpcre3-dev \
pkg-config \
cron \
wget \
unzip \
re2c \
composer \
php-mbstring \
php-memcached \
software-properties-common \
&& apt-get clean

Java Installation

RUN add-apt-repository ppa:openjdk-r/ppa
RUN apt-get update
RUN apt-get install openjdk-8-jre -y

Enable php modules

RUN pecl install inotify-2.0.0
RUN echo "extension=inotify.so" >> /etc/php/7.0/cli/php.ini
RUN echo "extension=inotify.so" >> /etc/php/7.0/apache2/php.ini

Enable xdebug

Need to install later xdebug

RUN pecl install xdebug

Install Gearman from source

RUN mkdir -p /tmp/install && cd /tmp/install && wget https://github.com/wcgallego/pecl-gearman/archive/master.zip && unzip master.zip && cd pecl-gearman-master && phpize && sh configure && make install
RUN echo "extension=gearman.so" >> /etc/php/7.0/mods-available/gearman.ini
RUN phpenmod -v ALL -s ALL gearman

Cassandra PHP extension installation

RUN cd /tmp && git clone https://github.com/datastax/php-driver.git && cd php-driver && git submodule update --init && cd ext && ./install.sh
RUN echo -e "; DataStax PHP Driver\nextension=cassandra.so" >> /etc/php/7.0/cli/php.ini
RUN echo -e "; DataStax PHP Driver\nextension=cassandra.so" >> /etc/php/7.0/apache2/php.ini

Cassandra C Library

RUN cd /tmp && git clone https://github.com/datastax/cpp-driver.git && mkdir cpp-driver/build && cd cpp-driver/build && cmake .. && make && make install

JSON-C Library

RUN cd /tmp && git clone https://github.com/json-c/json-c.git && cd json-c && sh autogen.sh && sh configure && make && make install

CURL Library

RUN cd /tmp && wget https://curl.haxx.se/download/curl-7.51.0.tar.gz && tar -xvf curl-7.51.0.tar.gz && cd curl-7.51.0 && sh configure && make && make install

GSL Library

RUN cd /tmp && wget http://ftp.eq.uc.pt/software/unix/gnu/gsl/gsl-latest.tar.gz && tar -xvf gsl-latest.tar.gz && cd gsl-2.2.1 && sh configure && make && make install

Set libraries path

#RUN export LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib:/usr/local/lib/x86_64-linux-gnu/

#RUN ln -s /usr/local/lib/x86_64-linux-gnu/libcassandra.so /usr/local/lib/libcassandra.so.2

#RUN ldconfig
COPY apache_default /etc/apache2/sites-available/000-default.conf
COPY run /usr/local/bin/run
COPY supervisor /etc/supervisor/conf.d/kde.conf
RUN chmod +x /usr/local/bin/run
RUN a2enmod rewrite

RUN sed 's/-l/#-l/' /etc/memcached.conf && sudo service memcached restart

EXPOSE 80 11211 4730
CMD ["/usr/local/bin/run"]

Docker Pull Command
Owner
marine