Answer the question
In order to leave comments, you need to log in
How to add PostgreSQL driver to php-fpm docker container?
There is this Dockerfile:
FROM php:fpm
RUN apt-get update && apt-get install -y \
curl \
wget \
git \
libfreetype6-dev \
libjpeg62-turbo-dev \
libmcrypt-dev \
libpng-dev \
&& pecl install mcrypt-1.0.1 \
&& docker-php-ext-enable mcrypt \
&& docker-php-ext-install -j$(nproc) iconv mbstring mysqli pdo_mysql zip \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
&& docker-php-ext-install -j$(nproc) gd
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
ADD ./php.ini /usr/local/etc/php/conf.d/40-custom.ini
WORKDIR /var/www
CMD ["php-fpm"]
Answer the question
In order to leave comments, you need to log in
RUN apt-get update && \
apt-get install -y libpq-dev && \
docker-php-ext-install pdo pdo_pgsql pgsql
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question