2018-02-16 18:40:13 +01:00
|
|
|
#
|
|
|
|
#--------------------------------------------------------------------------
|
|
|
|
# Image Setup
|
|
|
|
#--------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# To edit the 'php-fpm' base Image, visit its repository on Github
|
|
|
|
# https://github.com/Laradock/php-fpm
|
|
|
|
#
|
|
|
|
# To change its version, see the available Tags on the Docker Hub:
|
|
|
|
# https://hub.docker.com/r/laradock/php-fpm/tags/
|
|
|
|
#
|
|
|
|
# Note: Base Image name format {image-tag}-{php-version}
|
|
|
|
#
|
|
|
|
|
2018-07-29 06:00:13 +02:00
|
|
|
ARG LARADOCK_PHP_VERSION
|
2018-04-06 09:04:56 +02:00
|
|
|
|
2018-07-29 06:00:13 +02:00
|
|
|
FROM laradock/php-fpm:2.2-${LARADOCK_PHP_VERSION}
|
2018-02-16 18:40:13 +01:00
|
|
|
|
2018-03-16 10:34:47 +01:00
|
|
|
LABEL maintainer="Mahmoud Zalt <mahmoud@zalt.me>"
|
2018-02-16 18:40:13 +01:00
|
|
|
|
2018-07-29 06:00:13 +02:00
|
|
|
ARG LARADOCK_PHP_VERSION
|
|
|
|
|
2018-06-27 12:47:05 +02:00
|
|
|
# Set Environment Variables
|
|
|
|
ENV DEBIAN_FRONTEND noninteractive
|
|
|
|
|
2018-05-27 04:06:00 +02:00
|
|
|
# always run apt update when start and after add new source list, then clean up at end.
|
2018-05-28 02:47:22 +02:00
|
|
|
RUN apt-get update -yqq && \
|
2018-06-27 12:47:05 +02:00
|
|
|
apt-get install -y apt-utils && \
|
2018-05-28 02:47:22 +02:00
|
|
|
pecl channel-update pecl.php.net
|
2018-05-27 04:06:00 +02:00
|
|
|
|
2018-02-16 18:40:13 +01:00
|
|
|
#
|
|
|
|
#--------------------------------------------------------------------------
|
|
|
|
# Mandatory Software's Installation
|
|
|
|
#--------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# Mandatory Software's such as ("mcrypt", "pdo_mysql", "libssl-dev", ....)
|
|
|
|
# are installed on the base image 'laradock/php-fpm' image. If you want
|
|
|
|
# to add more Software's or remove existing one, you need to edit the
|
|
|
|
# base image (https://github.com/Laradock/php-fpm).
|
|
|
|
#
|
|
|
|
|
|
|
|
#
|
|
|
|
#--------------------------------------------------------------------------
|
|
|
|
# Optional Software's Installation
|
|
|
|
#--------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# Optional Software's will only be installed if you set them to `true`
|
|
|
|
# in the `docker-compose.yml` before the build.
|
|
|
|
# Example:
|
|
|
|
# - INSTALL_ZIP_ARCHIVE=true
|
|
|
|
#
|
|
|
|
|
2018-04-06 09:04:56 +02:00
|
|
|
###########################################################################
|
2018-02-16 18:40:13 +01:00
|
|
|
# SOAP:
|
2018-04-06 09:04:56 +02:00
|
|
|
###########################################################################
|
2018-02-16 18:40:13 +01:00
|
|
|
|
|
|
|
ARG INSTALL_SOAP=false
|
2018-04-06 09:04:56 +02:00
|
|
|
|
2018-02-16 18:40:13 +01:00
|
|
|
RUN if [ ${INSTALL_SOAP} = true ]; then \
|
|
|
|
# Install the soap extension
|
2018-05-26 01:47:29 +02:00
|
|
|
rm /etc/apt/preferences.d/no-debian-php && \
|
2018-02-16 18:40:13 +01:00
|
|
|
apt-get -y install libxml2-dev php-soap && \
|
|
|
|
docker-php-ext-install soap \
|
|
|
|
;fi
|
|
|
|
|
2018-04-06 09:04:56 +02:00
|
|
|
###########################################################################
|
2018-02-16 18:40:13 +01:00
|
|
|
# pgsql
|
2018-04-06 09:04:56 +02:00
|
|
|
###########################################################################
|
2018-02-16 18:40:13 +01:00
|
|
|
|
|
|
|
ARG INSTALL_PGSQL=false
|
2018-04-06 09:04:56 +02:00
|
|
|
|
2018-02-16 18:40:13 +01:00
|
|
|
RUN if [ ${INSTALL_PGSQL} = true ]; then \
|
|
|
|
# Install the pgsql extension
|
|
|
|
docker-php-ext-install pgsql \
|
|
|
|
;fi
|
|
|
|
|
2018-04-06 09:04:56 +02:00
|
|
|
###########################################################################
|
2018-02-16 18:40:13 +01:00
|
|
|
# pgsql client
|
2018-04-06 09:04:56 +02:00
|
|
|
###########################################################################
|
2018-02-16 18:40:13 +01:00
|
|
|
|
|
|
|
ARG INSTALL_PG_CLIENT=false
|
2018-04-06 09:04:56 +02:00
|
|
|
|
2018-02-16 18:40:13 +01:00
|
|
|
RUN if [ ${INSTALL_PG_CLIENT} = true ]; then \
|
2018-02-23 21:27:04 +01:00
|
|
|
# Create folders if not exists (https://github.com/tianon/docker-brew-debian/issues/65)
|
|
|
|
mkdir -p /usr/share/man/man1 && \
|
|
|
|
mkdir -p /usr/share/man/man7 && \
|
2018-02-16 18:40:13 +01:00
|
|
|
# Install the pgsql client
|
|
|
|
apt-get install -y postgresql-client \
|
|
|
|
;fi
|
|
|
|
|
2018-04-06 09:04:56 +02:00
|
|
|
###########################################################################
|
2018-02-16 18:40:13 +01:00
|
|
|
# xDebug:
|
2018-04-06 09:04:56 +02:00
|
|
|
###########################################################################
|
2018-02-16 18:40:13 +01:00
|
|
|
|
|
|
|
ARG INSTALL_XDEBUG=false
|
2018-04-06 09:04:56 +02:00
|
|
|
|
2018-02-16 18:40:13 +01:00
|
|
|
RUN if [ ${INSTALL_XDEBUG} = true ]; then \
|
2018-05-26 01:32:33 +02:00
|
|
|
# Install the xdebug extension
|
|
|
|
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \
|
|
|
|
pecl install xdebug-2.5.5; \
|
|
|
|
else \
|
|
|
|
pecl install xdebug; \
|
|
|
|
fi && \
|
|
|
|
docker-php-ext-enable xdebug \
|
2018-02-16 18:40:13 +01:00
|
|
|
;fi
|
|
|
|
|
|
|
|
# Copy xdebug configuration for remote debugging
|
|
|
|
COPY ./xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini
|
|
|
|
|
2018-06-24 03:46:12 +02:00
|
|
|
RUN sed -i "s/xdebug.remote_autostart=0/xdebug.remote_autostart=1/" /usr/local/etc/php/conf.d/xdebug.ini && \
|
|
|
|
sed -i "s/xdebug.remote_enable=0/xdebug.remote_enable=1/" /usr/local/etc/php/conf.d/xdebug.ini && \
|
|
|
|
sed -i "s/xdebug.cli_color=0/xdebug.cli_color=1/" /usr/local/etc/php/conf.d/xdebug.ini
|
|
|
|
|
2018-06-30 10:54:46 +02:00
|
|
|
###########################################################################
|
|
|
|
# Phpdbg:
|
|
|
|
###########################################################################
|
|
|
|
|
|
|
|
ARG INSTALL_PHPDBG=false
|
|
|
|
|
|
|
|
RUN if [ ${INSTALL_PHPDBG} = true ]; then \
|
|
|
|
# Load the xdebug extension only with phpunit commands
|
2018-07-29 06:00:13 +02:00
|
|
|
apt-get install -y --force-yes php${LARADOCK_PHP_VERSION}-phpdbg \
|
2018-06-30 10:54:46 +02:00
|
|
|
;fi
|
|
|
|
|
2018-04-06 09:04:56 +02:00
|
|
|
###########################################################################
|
2018-02-16 18:40:13 +01:00
|
|
|
# Blackfire:
|
2018-04-06 09:04:56 +02:00
|
|
|
###########################################################################
|
2018-02-16 18:40:13 +01:00
|
|
|
|
|
|
|
ARG INSTALL_BLACKFIRE=false
|
2018-04-06 09:04:56 +02:00
|
|
|
|
2018-02-16 18:40:13 +01:00
|
|
|
RUN if [ ${INSTALL_XDEBUG} = false -a ${INSTALL_BLACKFIRE} = true ]; then \
|
|
|
|
version=$(php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;") \
|
|
|
|
&& curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire.io/api/v1/releases/probe/php/linux/amd64/$version \
|
|
|
|
&& tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp \
|
|
|
|
&& mv /tmp/blackfire-*.so $(php -r "echo ini_get('extension_dir');")/blackfire.so \
|
|
|
|
&& printf "extension=blackfire.so\nblackfire.agent_socket=tcp://blackfire:8707\n" > $PHP_INI_DIR/conf.d/blackfire.ini \
|
|
|
|
;fi
|
|
|
|
|
2018-04-06 09:04:56 +02:00
|
|
|
###########################################################################
|
|
|
|
# PHP REDIS EXTENSION
|
|
|
|
###########################################################################
|
2018-02-16 18:40:13 +01:00
|
|
|
|
|
|
|
ARG INSTALL_PHPREDIS=false
|
2018-04-06 09:04:56 +02:00
|
|
|
|
2018-02-16 18:40:13 +01:00
|
|
|
RUN if [ ${INSTALL_PHPREDIS} = true ]; then \
|
|
|
|
# Install Php Redis Extension
|
|
|
|
printf "\n" | pecl install -o -f redis \
|
|
|
|
&& rm -rf /tmp/pear \
|
|
|
|
&& docker-php-ext-enable redis \
|
|
|
|
;fi
|
|
|
|
|
2018-04-06 09:04:56 +02:00
|
|
|
###########################################################################
|
|
|
|
# Swoole EXTENSION
|
|
|
|
###########################################################################
|
2018-02-16 18:40:13 +01:00
|
|
|
|
|
|
|
ARG INSTALL_SWOOLE=false
|
2018-04-06 09:04:56 +02:00
|
|
|
|
2018-02-16 18:40:13 +01:00
|
|
|
RUN if [ ${INSTALL_SWOOLE} = true ]; then \
|
|
|
|
# Install Php Swoole Extension
|
2018-05-27 13:47:13 +02:00
|
|
|
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \
|
|
|
|
pecl install swoole-2.0.11; \
|
|
|
|
else \
|
2018-06-18 15:27:23 +02:00
|
|
|
if [ $(php -r "echo PHP_MINOR_VERSION;") = "0" ]; then \
|
|
|
|
pecl install swoole-2.2.0; \
|
|
|
|
else \
|
|
|
|
pecl install swoole; \
|
|
|
|
fi \
|
2018-05-27 13:47:13 +02:00
|
|
|
fi && \
|
|
|
|
docker-php-ext-enable swoole \
|
2018-02-16 18:40:13 +01:00
|
|
|
;fi
|
|
|
|
|
2018-04-06 09:04:56 +02:00
|
|
|
###########################################################################
|
2018-02-16 18:40:13 +01:00
|
|
|
# MongoDB:
|
2018-04-06 09:04:56 +02:00
|
|
|
###########################################################################
|
2018-02-16 18:40:13 +01:00
|
|
|
|
|
|
|
ARG INSTALL_MONGO=false
|
2018-04-06 09:04:56 +02:00
|
|
|
|
2018-02-16 18:40:13 +01:00
|
|
|
RUN if [ ${INSTALL_MONGO} = true ]; then \
|
|
|
|
# Install the mongodb extension
|
2018-06-25 14:16:25 +02:00
|
|
|
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \
|
|
|
|
pecl install mongo && \
|
|
|
|
docker-php-ext-enable mongo \
|
|
|
|
;fi && \
|
2018-02-16 18:40:13 +01:00
|
|
|
pecl install mongodb && \
|
|
|
|
docker-php-ext-enable mongodb \
|
|
|
|
;fi
|
|
|
|
|
2018-04-06 09:04:56 +02:00
|
|
|
###########################################################################
|
2018-02-16 18:40:13 +01:00
|
|
|
# AMQP:
|
2018-04-06 09:04:56 +02:00
|
|
|
###########################################################################
|
2018-02-16 18:40:13 +01:00
|
|
|
|
|
|
|
ARG INSTALL_AMQP=false
|
2018-04-06 09:04:56 +02:00
|
|
|
|
2018-02-16 18:40:13 +01:00
|
|
|
RUN if [ ${INSTALL_AMQP} = true ]; then \
|
|
|
|
apt-get install librabbitmq-dev -y && \
|
|
|
|
# Install the amqp extension
|
|
|
|
pecl install amqp && \
|
|
|
|
docker-php-ext-enable amqp \
|
|
|
|
;fi
|
|
|
|
|
2018-04-06 09:04:56 +02:00
|
|
|
###########################################################################
|
2018-02-16 18:40:13 +01:00
|
|
|
# ZipArchive:
|
2018-04-06 09:04:56 +02:00
|
|
|
###########################################################################
|
2018-02-16 18:40:13 +01:00
|
|
|
|
|
|
|
ARG INSTALL_ZIP_ARCHIVE=false
|
2018-04-06 09:04:56 +02:00
|
|
|
|
2018-02-16 18:40:13 +01:00
|
|
|
RUN if [ ${INSTALL_ZIP_ARCHIVE} = true ]; then \
|
2018-06-27 12:46:27 +02:00
|
|
|
apt-get install libzip-dev -y && \
|
|
|
|
docker-php-ext-configure zip --with-libzip && \
|
2018-02-16 18:40:13 +01:00
|
|
|
# Install the zip extension
|
|
|
|
docker-php-ext-install zip \
|
|
|
|
;fi
|
|
|
|
|
2018-04-24 16:25:16 +02:00
|
|
|
###########################################################################
|
|
|
|
# pcntl
|
|
|
|
###########################################################################
|
|
|
|
|
|
|
|
ARG INSTALL_PCNTL=false
|
2018-06-27 12:47:42 +02:00
|
|
|
RUN if [ ${INSTALL_PCNTL} = true ]; then \
|
2018-04-24 16:25:16 +02:00
|
|
|
# Installs pcntl, helpful for running Horizon
|
|
|
|
docker-php-ext-install pcntl \
|
|
|
|
;fi
|
|
|
|
|
2018-04-06 09:04:56 +02:00
|
|
|
###########################################################################
|
2018-02-16 18:40:13 +01:00
|
|
|
# bcmath:
|
2018-04-06 09:04:56 +02:00
|
|
|
###########################################################################
|
2018-02-16 18:40:13 +01:00
|
|
|
|
|
|
|
ARG INSTALL_BCMATH=false
|
2018-04-06 09:04:56 +02:00
|
|
|
|
2018-02-16 18:40:13 +01:00
|
|
|
RUN if [ ${INSTALL_BCMATH} = true ]; then \
|
|
|
|
# Install the bcmath extension
|
|
|
|
docker-php-ext-install bcmath \
|
|
|
|
;fi
|
|
|
|
|
2018-04-06 09:04:56 +02:00
|
|
|
###########################################################################
|
2018-02-16 18:40:13 +01:00
|
|
|
# GMP (GNU Multiple Precision):
|
2018-04-06 09:04:56 +02:00
|
|
|
###########################################################################
|
2018-02-16 18:40:13 +01:00
|
|
|
|
|
|
|
ARG INSTALL_GMP=false
|
2018-04-06 09:04:56 +02:00
|
|
|
|
2018-02-16 18:40:13 +01:00
|
|
|
RUN if [ ${INSTALL_GMP} = true ]; then \
|
|
|
|
# Install the GMP extension
|
2018-05-27 14:01:29 +02:00
|
|
|
apt-get install -y libgmp-dev && \
|
|
|
|
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \
|
|
|
|
ln -s /usr/include/x86_64-linux-gnu/gmp.h /usr/include/gmp.h \
|
|
|
|
;fi && \
|
2018-02-16 18:40:13 +01:00
|
|
|
docker-php-ext-install gmp \
|
|
|
|
;fi
|
|
|
|
|
2018-04-06 09:04:56 +02:00
|
|
|
###########################################################################
|
2018-02-16 18:40:13 +01:00
|
|
|
# PHP Memcached:
|
2018-04-06 09:04:56 +02:00
|
|
|
###########################################################################
|
2018-02-16 18:40:13 +01:00
|
|
|
|
|
|
|
ARG INSTALL_MEMCACHED=false
|
2018-04-06 09:04:56 +02:00
|
|
|
|
2018-02-16 18:40:13 +01:00
|
|
|
RUN if [ ${INSTALL_MEMCACHED} = true ]; then \
|
|
|
|
# Install the php memcached extension
|
2018-06-01 02:45:56 +02:00
|
|
|
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \
|
|
|
|
curl -L -o /tmp/memcached.tar.gz "https://github.com/php-memcached-dev/php-memcached/archive/2.2.0.tar.gz"; \
|
|
|
|
else \
|
|
|
|
curl -L -o /tmp/memcached.tar.gz "https://github.com/php-memcached-dev/php-memcached/archive/php7.tar.gz"; \
|
|
|
|
fi \
|
2018-02-16 18:40:13 +01:00
|
|
|
&& mkdir -p memcached \
|
|
|
|
&& tar -C memcached -zxvf /tmp/memcached.tar.gz --strip 1 \
|
|
|
|
&& ( \
|
|
|
|
cd memcached \
|
|
|
|
&& phpize \
|
|
|
|
&& ./configure \
|
|
|
|
&& make -j$(nproc) \
|
|
|
|
&& make install \
|
|
|
|
) \
|
|
|
|
&& rm -r memcached \
|
|
|
|
&& rm /tmp/memcached.tar.gz \
|
|
|
|
&& docker-php-ext-enable memcached \
|
|
|
|
;fi
|
|
|
|
|
2018-04-06 09:04:56 +02:00
|
|
|
###########################################################################
|
2018-02-16 18:40:13 +01:00
|
|
|
# Exif:
|
2018-04-06 09:04:56 +02:00
|
|
|
###########################################################################
|
2018-02-16 18:40:13 +01:00
|
|
|
|
|
|
|
ARG INSTALL_EXIF=false
|
2018-04-06 09:04:56 +02:00
|
|
|
|
2018-02-16 18:40:13 +01:00
|
|
|
RUN if [ ${INSTALL_EXIF} = true ]; then \
|
|
|
|
# Enable Exif PHP extentions requirements
|
|
|
|
docker-php-ext-install exif \
|
|
|
|
;fi
|
|
|
|
|
2018-04-06 09:04:56 +02:00
|
|
|
###########################################################################
|
2018-02-16 18:40:13 +01:00
|
|
|
# PHP Aerospike:
|
2018-04-06 09:04:56 +02:00
|
|
|
###########################################################################
|
|
|
|
|
2018-03-19 15:15:24 +01:00
|
|
|
USER root
|
2018-02-16 18:40:13 +01:00
|
|
|
|
|
|
|
ARG INSTALL_AEROSPIKE=false
|
2018-05-31 19:30:35 +02:00
|
|
|
ARG AEROSPIKE_PHP_REPOSITORY
|
2018-02-16 18:40:13 +01:00
|
|
|
|
|
|
|
RUN if [ ${INSTALL_AEROSPIKE} = true ]; then \
|
|
|
|
# Fix dependencies for PHPUnit within aerospike extension
|
|
|
|
apt-get -y install sudo wget && \
|
2018-04-06 09:04:56 +02:00
|
|
|
# Install the php aerospike extension
|
2018-06-01 05:02:20 +02:00
|
|
|
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \
|
|
|
|
curl -L -o /tmp/aerospike-client-php.tar.gz https://github.com/aerospike/aerospike-client-php5/archive/master.tar.gz; \
|
|
|
|
else \
|
|
|
|
curl -L -o /tmp/aerospike-client-php.tar.gz ${AEROSPIKE_PHP_REPOSITORY}; \
|
|
|
|
fi \
|
2018-02-16 18:40:13 +01:00
|
|
|
&& mkdir -p aerospike-client-php \
|
|
|
|
&& tar -C aerospike-client-php -zxvf /tmp/aerospike-client-php.tar.gz --strip 1 \
|
2018-06-01 05:02:20 +02:00
|
|
|
&& \
|
|
|
|
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \
|
|
|
|
( \
|
|
|
|
cd aerospike-client-php/src/aerospike \
|
|
|
|
&& phpize \
|
|
|
|
&& ./build.sh \
|
|
|
|
&& make install \
|
|
|
|
) \
|
|
|
|
else \
|
|
|
|
( \
|
|
|
|
cd aerospike-client-php/src \
|
|
|
|
&& phpize \
|
|
|
|
&& ./build.sh \
|
|
|
|
&& make install \
|
|
|
|
) \
|
|
|
|
fi \
|
2018-02-16 18:40:13 +01:00
|
|
|
&& rm /tmp/aerospike-client-php.tar.gz \
|
2018-03-19 15:15:24 +01:00
|
|
|
&& docker-php-ext-enable aerospike \
|
2018-02-16 18:40:13 +01:00
|
|
|
;fi
|
|
|
|
|
2018-04-06 09:04:56 +02:00
|
|
|
###########################################################################
|
2018-02-16 18:40:13 +01:00
|
|
|
# Opcache:
|
2018-04-06 09:04:56 +02:00
|
|
|
###########################################################################
|
2018-02-16 18:40:13 +01:00
|
|
|
|
|
|
|
ARG INSTALL_OPCACHE=false
|
2018-04-06 09:04:56 +02:00
|
|
|
|
2018-02-16 18:40:13 +01:00
|
|
|
RUN if [ ${INSTALL_OPCACHE} = true ]; then \
|
|
|
|
docker-php-ext-install opcache \
|
|
|
|
;fi
|
|
|
|
|
|
|
|
# Copy opcache configration
|
|
|
|
COPY ./opcache.ini /usr/local/etc/php/conf.d/opcache.ini
|
|
|
|
|
2018-04-06 09:04:56 +02:00
|
|
|
###########################################################################
|
2018-02-16 18:40:13 +01:00
|
|
|
# Mysqli Modifications:
|
2018-04-06 09:04:56 +02:00
|
|
|
###########################################################################
|
2018-02-16 18:40:13 +01:00
|
|
|
|
|
|
|
ARG INSTALL_MYSQLI=false
|
2018-04-06 09:04:56 +02:00
|
|
|
|
2018-02-16 18:40:13 +01:00
|
|
|
RUN if [ ${INSTALL_MYSQLI} = true ]; then \
|
|
|
|
docker-php-ext-install mysqli \
|
|
|
|
;fi
|
|
|
|
|
2018-04-06 09:04:56 +02:00
|
|
|
###########################################################################
|
2018-02-16 18:40:13 +01:00
|
|
|
# Tokenizer Modifications:
|
2018-04-06 09:04:56 +02:00
|
|
|
###########################################################################
|
2018-02-16 18:40:13 +01:00
|
|
|
|
|
|
|
ARG INSTALL_TOKENIZER=false
|
2018-04-06 09:04:56 +02:00
|
|
|
|
2018-02-16 18:40:13 +01:00
|
|
|
RUN if [ ${INSTALL_TOKENIZER} = true ]; then \
|
|
|
|
docker-php-ext-install tokenizer \
|
|
|
|
;fi
|
|
|
|
|
2018-04-06 09:04:56 +02:00
|
|
|
###########################################################################
|
2018-02-16 18:40:13 +01:00
|
|
|
# Human Language and Character Encoding Support:
|
2018-04-06 09:04:56 +02:00
|
|
|
###########################################################################
|
2018-02-16 18:40:13 +01:00
|
|
|
|
|
|
|
ARG INSTALL_INTL=false
|
2018-04-06 09:04:56 +02:00
|
|
|
|
2018-02-16 18:40:13 +01:00
|
|
|
RUN if [ ${INSTALL_INTL} = true ]; then \
|
|
|
|
# Install intl and requirements
|
|
|
|
apt-get install -y zlib1g-dev libicu-dev g++ && \
|
|
|
|
docker-php-ext-configure intl && \
|
|
|
|
docker-php-ext-install intl \
|
|
|
|
;fi
|
|
|
|
|
2018-04-06 09:04:56 +02:00
|
|
|
###########################################################################
|
2018-02-16 18:40:13 +01:00
|
|
|
# GHOSTSCRIPT:
|
2018-04-06 09:04:56 +02:00
|
|
|
###########################################################################
|
2018-02-16 18:40:13 +01:00
|
|
|
|
|
|
|
ARG INSTALL_GHOSTSCRIPT=false
|
2018-04-06 09:04:56 +02:00
|
|
|
|
2018-02-16 18:40:13 +01:00
|
|
|
RUN if [ ${INSTALL_GHOSTSCRIPT} = true ]; then \
|
|
|
|
# Install the ghostscript extension
|
|
|
|
# for PDF editing
|
2018-04-06 09:04:56 +02:00
|
|
|
apt-get install -y \
|
2018-02-16 18:40:13 +01:00
|
|
|
poppler-utils \
|
|
|
|
ghostscript \
|
|
|
|
;fi
|
|
|
|
|
2018-04-06 09:04:56 +02:00
|
|
|
###########################################################################
|
2018-02-16 18:40:13 +01:00
|
|
|
# LDAP:
|
2018-04-06 09:04:56 +02:00
|
|
|
###########################################################################
|
2018-02-16 18:40:13 +01:00
|
|
|
|
|
|
|
ARG INSTALL_LDAP=false
|
2018-04-06 09:04:56 +02:00
|
|
|
|
2018-02-16 18:40:13 +01:00
|
|
|
RUN if [ ${INSTALL_LDAP} = true ]; then \
|
|
|
|
apt-get install -y libldap2-dev && \
|
|
|
|
docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/ && \
|
|
|
|
docker-php-ext-install ldap \
|
|
|
|
;fi
|
|
|
|
|
2018-04-06 09:04:56 +02:00
|
|
|
###########################################################################
|
2018-02-16 18:40:13 +01:00
|
|
|
# SQL SERVER:
|
2018-04-06 09:04:56 +02:00
|
|
|
###########################################################################
|
|
|
|
|
2018-02-16 18:40:13 +01:00
|
|
|
ARG INSTALL_MSSQL=false
|
2018-04-06 09:04:56 +02:00
|
|
|
|
2018-03-24 06:56:06 +01:00
|
|
|
RUN set -eux; if [ ${INSTALL_MSSQL} = true ]; then \
|
2018-06-11 08:23:40 +02:00
|
|
|
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \
|
|
|
|
apt-get -y install freetds-dev libsybdb5 \
|
|
|
|
&& ln -s /usr/lib/x86_64-linux-gnu/libsybdb.so /usr/lib/libsybdb.so \
|
|
|
|
&& docker-php-ext-install mssql pdo_dblib \
|
|
|
|
&& php -m | grep -q 'mssql' \
|
|
|
|
&& php -m | grep -q 'pdo_dblib' \
|
|
|
|
;else \
|
|
|
|
###########################################################################
|
|
|
|
# Ref from https://github.com/Microsoft/msphpsql/wiki/Dockerfile-for-adding-pdo_sqlsrv-and-sqlsrv-to-official-php-image
|
|
|
|
###########################################################################
|
|
|
|
# Add Microsoft repo for Microsoft ODBC Driver 13 for Linux
|
|
|
|
apt-get install -y apt-transport-https gnupg \
|
|
|
|
&& curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \
|
2018-07-28 09:08:01 +02:00
|
|
|
&& curl https://packages.microsoft.com/config/debian/9/prod.list > /etc/apt/sources.list.d/mssql-release.list \
|
2018-06-11 08:23:40 +02:00
|
|
|
&& apt-get update -yqq \
|
|
|
|
# Install Dependencies
|
2018-07-28 09:08:01 +02:00
|
|
|
&& ACCEPT_EULA=Y apt-get install -y unixodbc unixodbc-dev libgss3 odbcinst msodbcsql17 locales \
|
2018-06-11 08:23:40 +02:00
|
|
|
&& echo "en_US.UTF-8 UTF-8" > /etc/locale.gen \
|
2018-07-28 09:08:01 +02:00
|
|
|
# link local aliases
|
2018-07-29 06:42:13 +02:00
|
|
|
&& ln -sfn /etc/locale.alias /usr/share/locale/locale.alias \
|
2018-06-11 08:23:40 +02:00
|
|
|
&& locale-gen \
|
|
|
|
# Install pdo_sqlsrv and sqlsrv from PECL. Replace pdo_sqlsrv-4.1.8preview with preferred version.
|
2018-07-28 09:08:01 +02:00
|
|
|
&& pecl install pdo_sqlsrv sqlsrv \
|
2018-06-11 08:23:40 +02:00
|
|
|
&& docker-php-ext-enable pdo_sqlsrv sqlsrv \
|
|
|
|
&& php -m | grep -q 'pdo_sqlsrv' \
|
|
|
|
&& php -m | grep -q 'sqlsrv' \
|
|
|
|
;fi \
|
2018-02-16 18:40:13 +01:00
|
|
|
;fi
|
|
|
|
|
2018-04-06 09:04:56 +02:00
|
|
|
###########################################################################
|
2018-02-16 18:40:13 +01:00
|
|
|
# Image optimizers:
|
2018-04-06 09:04:56 +02:00
|
|
|
###########################################################################
|
|
|
|
|
2018-02-16 18:40:13 +01:00
|
|
|
USER root
|
2018-04-06 09:04:56 +02:00
|
|
|
|
2018-02-16 18:40:13 +01:00
|
|
|
ARG INSTALL_IMAGE_OPTIMIZERS=false
|
2018-04-06 09:04:56 +02:00
|
|
|
|
2018-02-16 18:40:13 +01:00
|
|
|
RUN if [ ${INSTALL_IMAGE_OPTIMIZERS} = true ]; then \
|
2018-06-24 17:19:49 +02:00
|
|
|
apt-get install -y jpegoptim optipng pngquant gifsicle \
|
2018-02-16 18:40:13 +01:00
|
|
|
;fi
|
|
|
|
|
2018-04-06 09:04:56 +02:00
|
|
|
###########################################################################
|
2018-02-16 18:40:13 +01:00
|
|
|
# ImageMagick:
|
2018-04-06 09:04:56 +02:00
|
|
|
###########################################################################
|
|
|
|
|
2018-02-16 18:40:13 +01:00
|
|
|
USER root
|
2018-04-06 09:04:56 +02:00
|
|
|
|
2018-02-16 18:40:13 +01:00
|
|
|
ARG INSTALL_IMAGEMAGICK=false
|
2018-04-06 09:04:56 +02:00
|
|
|
|
2018-02-16 18:40:13 +01:00
|
|
|
RUN if [ ${INSTALL_IMAGEMAGICK} = true ]; then \
|
2018-02-23 21:27:04 +01:00
|
|
|
apt-get install -y libmagickwand-dev imagemagick && \
|
2018-02-16 18:40:13 +01:00
|
|
|
pecl install imagick && \
|
|
|
|
docker-php-ext-enable imagick \
|
|
|
|
;fi
|
|
|
|
|
2018-04-06 09:04:56 +02:00
|
|
|
###########################################################################
|
2018-02-26 14:27:56 +01:00
|
|
|
# IMAP:
|
2018-04-06 09:04:56 +02:00
|
|
|
###########################################################################
|
|
|
|
|
2018-02-26 14:27:56 +01:00
|
|
|
ARG INSTALL_IMAP=false
|
2018-04-06 09:04:56 +02:00
|
|
|
|
2018-02-26 14:27:56 +01:00
|
|
|
RUN if [ ${INSTALL_IMAP} = true ]; then \
|
|
|
|
apt-get install -y libc-client-dev libkrb5-dev && \
|
|
|
|
rm -r /var/lib/apt/lists/* && \
|
|
|
|
docker-php-ext-configure imap --with-kerberos --with-imap-ssl && \
|
|
|
|
docker-php-ext-install imap \
|
|
|
|
;fi
|
|
|
|
|
2018-07-13 12:31:13 +02:00
|
|
|
###########################################################################
|
|
|
|
# Calendar:
|
|
|
|
###########################################################################
|
|
|
|
|
|
|
|
USER root
|
|
|
|
|
|
|
|
ARG INSTALL_CALENDAR=false
|
|
|
|
|
|
|
|
RUN if [ ${INSTALL_CALENDAR} = true ]; then \
|
|
|
|
docker-php-ext-configure calendar && \
|
|
|
|
docker-php-ext-install calendar \
|
|
|
|
;fi
|
|
|
|
|
2018-08-21 07:41:34 +02:00
|
|
|
###########################################################################
|
|
|
|
# libfaketime:
|
|
|
|
###########################################################################
|
|
|
|
|
|
|
|
USER root
|
|
|
|
|
|
|
|
ARG INSTALL_FAKETIME=false
|
|
|
|
|
|
|
|
RUN if [ ${INSTALL_FAKETIME} = true ]; then \
|
|
|
|
apt-get install -y libfaketime \
|
|
|
|
;fi
|
|
|
|
|
2018-04-06 09:04:56 +02:00
|
|
|
###########################################################################
|
2018-02-17 09:26:46 +01:00
|
|
|
# Check PHP version:
|
2018-04-06 09:04:56 +02:00
|
|
|
###########################################################################
|
|
|
|
|
2018-07-29 06:00:13 +02:00
|
|
|
RUN php -v | head -n 1 | grep -q "PHP ${LARADOCK_PHP_VERSION}."
|
2018-02-17 09:26:46 +01:00
|
|
|
|
2018-02-16 18:40:13 +01:00
|
|
|
#
|
|
|
|
#--------------------------------------------------------------------------
|
|
|
|
# Final Touch
|
|
|
|
#--------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
|
2018-04-04 14:13:11 +02:00
|
|
|
COPY ./laravel.ini /usr/local/etc/php/conf.d
|
|
|
|
COPY ./xlaravel.pool.conf /usr/local/etc/php-fpm.d/
|
2018-02-16 18:40:13 +01:00
|
|
|
|
2018-04-06 09:04:56 +02:00
|
|
|
USER root
|
|
|
|
|
|
|
|
# Clean up
|
|
|
|
RUN apt-get clean && \
|
|
|
|
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
|
|
|
|
rm /var/log/lastlog /var/log/faillog
|
2018-02-16 18:40:13 +01:00
|
|
|
|
|
|
|
RUN usermod -u 1000 www-data
|
|
|
|
|
2018-08-21 07:41:34 +02:00
|
|
|
# Adding the faketime library to the preload file needs to be done last
|
|
|
|
# otherwise it will preload it for all commands that follow in this file
|
|
|
|
RUN if [ ${INSTALL_FAKETIME} = true ]; then \
|
|
|
|
echo "/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1" > /etc/ld.so.preload \
|
|
|
|
;fi
|
|
|
|
|
2018-02-16 18:40:13 +01:00
|
|
|
WORKDIR /var/www
|
|
|
|
|
|
|
|
CMD ["php-fpm"]
|
|
|
|
|
|
|
|
EXPOSE 9000
|