Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Dockerfile for PHP 8.0 RC2 with MySQL and Postgres support

Dockerfile contents in the image located at :

The above link takes you directly to tag "1", and the image's generic URL is:

#PHP 8.x RC2!
FROM php:8.0.0RC2-apache

RUN apt-get update

# Install composer
RUN curl -sS | php -- --install-dir=/usr/local/bin --filename=composer

#Install zip+icu dev libs + pgsql dev support
RUN apt-get install libzip-dev zip libicu-dev libpq-dev -y

#Install PHP extensions zip and intl (intl requires to be configured)
RUN docker-php-ext-install zip && docker-php-ext-configure intl && docker-php-ext-install intl

# Add MySQL and Postgres/pgsql support
RUN docker-php-ext-install mysqli pdo pdo_mysql && docker-php-ext-enable pdo_mysql
RUN docker-php-ext-configure pgsql -with-pgsql=/usr/local/pgsql && docker-php-ext-install pdo_pgsql pgsql

#Required for htaccess rewrite rules
RUN a2enmod rewrite
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment