Skip to content

Instantly share code, notes, and snippets.

@tigusigalpa
Last active July 6, 2025 07:17
Show Gist options
  • Save tigusigalpa/ae70b0d0e13ac1d85b9ce9d4e56978a3 to your computer and use it in GitHub Desktop.
Save tigusigalpa/ae70b0d0e13ac1d85b9ce9d4e56978a3 to your computer and use it in GitHub Desktop.
PHP 5.6 FPM Dockerfile with MySQL
FROM php:5.6-fpm
RUN sed -i 's|deb.debian.org/debian|archive.debian.org/debian|g' /etc/apt/sources.list && \
sed -i '/security.debian.org/d' /etc/apt/sources.list && \
sed -i '/stretch-updates/d' /etc/apt/sources.list && \
echo 'Acquire::Check-Valid-Until "false";' > /etc/apt/apt.conf.d/99no-check-valid-until && \
echo 'Acquire::AllowInsecureRepositories "true";' > /etc/apt/apt.conf.d/99allow-insecure && \
echo 'APT::Get::AllowUnauthenticated "true";' >> /etc/apt/apt.conf.d/99allow-insecure
RUN apt-get update && apt-get install -y --no-install-recommends \
nano \
vim \
unzip \
libzip-dev \
wget \
git \
libpng-dev \
libjpeg62-turbo-dev \
libfreetype6-dev \
libmcrypt-dev \
libonig-dev \
locales \
zlib1g-dev \
libssl-dev \
&& docker-php-ext-install mcrypt \
&& rm -rf /var/lib/apt/lists/*
RUN docker-php-ext-install mbstring exif pcntl ctype fileinfo bcmath gettext pdo
# MySQL
RUN docker-php-ext-install mysqli pdo_mysql
RUN docker-php-ext-enable mysqli pdo_mysql
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/
RUN docker-php-ext-install gd
WORKDIR /var/www/html
CMD ["php-fpm"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment