# Create a base Ubuntu image to build upon
# docker build --rm -f Dockerfile-71 -t composer:7.1 .
FROM ubuntu:16.04
MAINTAINER Richard Morgan <r_morgan@sympatico.ca>

WORKDIR /opt/project

EXPOSE 9000

# set terminal variable so that tools such as nano and htop work
# this is not needed in prod containers, but is useful for devs
ENV TERM=xterm

RUN apt-get update && apt-get install -y software-properties-common python-software-properties \
  && LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php \
  && apt-get update && apt-get install -y \
    curl nano sed libwww-perl htop ca-certificates \
    php7.2 php7.2-cli php7.2-fpm php7.2-curl php-pear php7.2-zip php7.2-mbstring php7.2-xml \
    php7.2-mysql php7.2-pgsql php7.2-redis \
    php-mcrypt php7.2-http \
    \
  && apt-cache pkgnames | grep php7.2 \
  && rm /usr/bin/php && ln -s /usr/bin/php7.2 /usr/bin/php \
  && ln -s /usr/sbin/php-fpm7.2 /usr/sbin/php-fpm \
  && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

COPY ./docker-php-fpm.conf /etc/php/7.2/fpm/pool.d/www.conf

CMD ["/usr/sbin/php-fpm7.2", "-F"]

#php7.2-mcrypt
