Skip to content

Instantly share code, notes, and snippets.

@jdecode
Last active February 28, 2024 09:11
Show Gist options
  • Save jdecode/77b554ba217c5dfcf5f78f89260c8561 to your computer and use it in GitHub Desktop.
Save jdecode/77b554ba217c5dfcf5f78f89260c8561 to your computer and use it in GitHub Desktop.
Dockerfile for PHP 8.0 RC2 with MySQL and Postgres support

Dockerfile contents in the image located at : https://hub.docker.com/layers/jdecode/php8.0rc2/1/images/sha256-f732b4df8f6021e6c0dada4d31d0444d916ffe204da597d81f24f443ebced6d1?context=explore

The above link takes you directly to tag "1", and the image's generic URL is: https://hub.docker.com/r/jdecode/php8.0rc2

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

#Update!
RUN apt-get update

# Install composer
RUN curl -sS https://getcomposer.org/installer | 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