Skip to content

Instantly share code, notes, and snippets.

@ben-albon
Last active February 12, 2026 14:24
Show Gist options
  • Select an option

  • Save ben-albon/3c33628662dcd4120bf4 to your computer and use it in GitHub Desktop.

Select an option

Save ben-albon/3c33628662dcd4120bf4 to your computer and use it in GitHub Desktop.
Docker PHP Image with PostgreSQL Driver
FROM php:5.6-apache
RUN apt-get update && apt-get install -y libpq-dev && docker-php-ext-install pdo pdo_pgsql
COPY src/ /var/www/html
@Thanawat1997
Copy link

Thanks!

It works on PHP 8.2-apache-bullseye

Dockerfile:

FROM php:8.2-apache-bullseye
RUN apt-get update && apt-get install -y libpq-dev && docker-php-ext-install pdo pdo_pgsql
COPY ./ /var/www/html
EXPOSE 80

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment