Skip to content

Instantly share code, notes, and snippets.

@jgauthi
Last active September 21, 2023 09:32
Show Gist options
  • Save jgauthi/066e4afbb7a4ac47142bb805a58824cd to your computer and use it in GitHub Desktop.
Save jgauthi/066e4afbb7a4ac47142bb805a58824cd to your computer and use it in GitHub Desktop.
Dockerfile php5.6 (with fix for old debian packages)
FROM php:5.6
# Update stretch repositories for old packages: https://stackoverflow.com/a/76095392
RUN sed -i -e 's/deb.debian.org/archive.debian.org/g' \
-e 's|security.debian.org|archive.debian.org/|g' \
-e '/stretch-updates/d' /etc/apt/sources.list
# Some libs
RUN apt-get update --fix-missing && apt-get install -y vim curl locales apt-utils git qrencode imagemagick memcached zip unzip
# https://github.com/mlocati/docker-php-extension-installer
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/
RUN install-php-extensions \
intl \
exif gd imagick \
memcached \
mcrypt \
mysql mysqli pdo_mysql \
mbstring \
soap \
tidy \
xdebug \
zip
# Install composer
COPY --from=composer:2.2 /usr/bin/composer /usr/local/bin/composer
# PHP Conf
COPY php.ini /usr/local/etc/php/php.ini
COPY php-fpm-pool.conf /usr/local/etc/php/php-fpm.conf
RUN usermod -u 1000 www-data
RUN echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && \
echo "fr_FR.UTF-8 UTF-8" >> /etc/locale.gen && \
locale-gen
# Purge
RUN rm -rf /var/lib/apt/lists/* \
&& apt-get purge --auto-remove -y g++ \
&& apt-get clean
WORKDIR /var/www
EXPOSE 9000
CMD /etc/init.d/memcached start ; php-fpm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment