Skip to content

Instantly share code, notes, and snippets.

@albertobraschi
Created February 6, 2020 21:31
Show Gist options
  • Save albertobraschi/d27934076c3c5714c0d3e056cd88839c to your computer and use it in GitHub Desktop.
Save albertobraschi/d27934076c3c5714c0d3e056cd88839c to your computer and use it in GitHub Desktop.
FROM php:7.2-fpm
# Install dependencies
RUN apt-get update \
&& apt-get install -y \
cron \
libfreetype6-dev \
libicu-dev \
libjpeg62-turbo-dev \
libmcrypt-dev \
libpng-dev \
libxslt1-dev
RUN apt-get update && \
apt-get install vim git -y
# Configure the gd library
RUN docker-php-ext-configure \
gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/
RUN apt-get install libmcrypt-dev
RUN pecl install mcrypt-1.0.1 && docker-php-ext-enable mcrypt
# compression
RUN apt-get update \
&& apt-get install -y \
libbz2-dev \
zlib1g-dev \
libzip-dev \
&& docker-php-ext-install -j$(nproc) \
zip \
bz2
# Install required PHP extensions
RUN docker-php-ext-install \
gd \
intl \
mbstring \
pdo_mysql \
xsl \
zip \
soap
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends libssh2-1-dev; \
pecl install ssh2-1.1.2; \
docker-php-ext-enable ssh2
# PECL
RUN pecl install \
redis-5.1.1 \
apcu-5.1.18
# Install the 2.4 version of xdebug that's compatible with php7
RUN pecl install xdebug-2.8.0 \
docker-php-ext-enable php_xdebug
# Install composer and put binary into $PATH
RUN curl -sS https://getcomposer.org/installer | php \
&& mv composer.phar /usr/local/bin/ \
&& ln -s /usr/local/bin/composer.phar /usr/local/bin/composer
ADD php.ini /usr/local/etc/php/conf.d/docker-php.ini
# Redis
RUN apt-get update \
&& apt-get install -y redis-server
EXPOSE 6379
# Clean
RUN apt-get clean
RUN rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /var/cache/*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment