Skip to content

Instantly share code, notes, and snippets.

@jpswade
Created July 31, 2018 20:28
Show Gist options
  • Save jpswade/9a45b66111adaa4222f4652c586616be to your computer and use it in GitHub Desktop.
Save jpswade/9a45b66111adaa4222f4652c586616be to your computer and use it in GitHub Desktop.
PHP56 Build Dockerfile
FROM php:5.6-apache
MAINTAINER James Wade <[email protected]>
# Install gd, iconv, mbstring, mcrypt, mysql, soap, sockets, zip, and zlib extensions
# see example at https://hub.docker.com/_/php/
RUN apt-get update && apt-get install -y \
libbz2-dev \
libfreetype6-dev \
libgd-dev \
libjpeg62-turbo-dev \
libmcrypt-dev \
libpng-dev \
libxml2-dev \
zlib1g-dev \
&& docker-php-ext-install iconv mbstring mcrypt soap sockets zip \
&& docker-php-ext-configure gd --enable-gd-native-ttf --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
&& docker-php-ext-install gd \
&& docker-php-ext-configure mysql --with-mysql=mysqlnd \
&& docker-php-ext-install mysql
# enable mod_rewrite
RUN a2enmod rewrite
# make the webroot a volume
VOLUME /var/www/html/
# In images building upon this image, copy the src/ directory to the webserver
# root and correct the owner.
ONBUILD COPY / /var/www/html/
ONBUILD RUN chown -R www-data:www-data /var/www/html
EXPOSE 80
ENTRYPOINT ["apache2-foreground"]
#EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment