Skip to content

Instantly share code, notes, and snippets.

@zillingen
Last active October 7, 2020 07:43
Show Gist options
  • Save zillingen/03add0dbb11ac4787057d3bbfedfe596 to your computer and use it in GitHub Desktop.
Save zillingen/03add0dbb11ac4787057d3bbfedfe596 to your computer and use it in GitHub Desktop.

Dockerfile for php-fpm image with mongodb, postgres and mysql

FROM php:7.4-fpm

RUN apt-get update \
  && apt-get install -y \
             apt-utils \
             man \
             curl \
             git \
             bash \
             vim \
             zip unzip \
             acl \
             iproute2 \
             dnsutils \
             fonts-freefont-ttf \
             fontconfig \
             dbus \
             openssh-client \
             sendmail \
             libfreetype6-dev \
             libjpeg62-turbo-dev \
             icu-devtools \
             libicu-dev \
             libmcrypt4 \
             libmcrypt-dev \
             libpng-dev \
             zlib1g-dev \
             libxml2-dev \
             libzip-dev \
             libonig-dev \
             graphviz \
             libcurl4-openssl-dev \
             pkg-config \
             libldap2-dev \
             libpq-dev \
  && pecl install mongodb \
  && echo "extension=mongodb.so" > /usr/local/etc/php/conf.d/mongodb-ext.ini

RUN docker-php-ext-configure intl --enable-intl && \
    docker-php-ext-configure gd --with-freetype --with-jpeg && \
    docker-php-ext-install -j$(nproc) gd && \
    docker-php-ext-install pdo \
        pgsql pdo_pgsql \
        mysqli pdo_mysql \
        intl iconv mbstring \
        zip pcntl \
        exif opcache \
    && docker-php-source delete 
    
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer

# Change UID `www-data`
# RUN usermod -u 33 www-data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment