Skip to content

Instantly share code, notes, and snippets.

@Sirpyerre
Created June 23, 2022 21:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Sirpyerre/49b4f3a7ba98bd82e608a665617ed0a6 to your computer and use it in GitHub Desktop.
Save Sirpyerre/49b4f3a7ba98bd82e608a665617ed0a6 to your computer and use it in GitHub Desktop.
dockerfile php7.3, apache, mezzio and mongodb
FROM php:7.3-apache
## Update package information
RUN apt-get update
## Configure Apache
RUN a2enmod rewrite \
&& sed -i 's!/var/www/html!/var/www/public!g' /etc/apache2/sites-available/000-default.conf \
&& mv /var/www/html /var/www/public
## Install Composer
RUN curl -sS https://getcomposer.org/installer \
| php -- --install-dir=/usr/local/bin --filename=composer
###
## PHP Extensisons
###
## Install zip libraries and extension
RUN apt-get install --yes git zlib1g-dev libzip-dev \
&& docker-php-ext-install zip
## Install intl library and extension
RUN apt-get install --yes libicu-dev \
&& docker-php-ext-configure intl \
&& docker-php-ext-install intl
RUN apt-get install --yes sqlite3
###
## Optional PHP extensions
###
## mbstring for i18n string support
# RUN docker-php-ext-install mbstring
###
## Some laminas/laminas-db supported PDO extensions
###
## MySQL PDO support
# RUN docker-php-ext-install pdo_mysql
## PostgreSQL PDO support
# RUN apt-get install --yes libpq-dev \
# && docker-php-ext-install pdo_pgsql
###
## laminas/laminas-cache supported extensions
###
## APCU
# RUN pecl install apcu \
# && docker-php-ext-enable apcu
## Memcached
# RUN apt-get install --yes libmemcached-dev \
# && pecl install memcached \
# && docker-php-ext-enable memcached
## MongoDB
RUN pecl install mongodb \
&& docker-php-ext-enable mongodb
## Redis support. igbinary and libzstd-dev are only needed based on
## redis pecl options
# RUN pecl install igbinary \
# && docker-php-ext-enable igbinary \
# && apt-get install --yes libzstd-dev \
# && pecl install redis \
# && docker-php-ext-enable redis
WORKDIR /var/www
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment