Here is my command to add pgsql library to my php docker file.

RUN apt-get install -y libpq-dev && docker-php-ext-install pdo pdo_pgsql pgsql