# Create a base Ubuntu image to build upon
# docker build --rm -f Dockerfile-71 -t composer:7.1 .
#FROM ubuntu:16.04
FROM php:7.3-fpm as base
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

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

ENTRYPOINT ["php-fpm"]
CMD ["-FO"]

ENV DEPS \
    libpq-dev \
    libzip-dev

RUN apt-get update && apt-get install -y $DEPS

RUN pecl install redis-5.1.1 \
    && pecl install raphf-2.0.1 \
    && docker-php-ext-enable redis raphf

RUN docker-php-ext-configure pgsql \
    && docker-php-ext-install -j$(nproc) pdo pdo_pgsql\
    && docker-php-ext-install -j$(nproc) zip

