Skip to content

Instantly share code, notes, and snippets.

@jpswade
Created May 20, 2019 10:42
Show Gist options
  • Save jpswade/5aecb423d93018137a3262b2adb667bb to your computer and use it in GitHub Desktop.
Save jpswade/5aecb423d93018137a3262b2adb667bb to your computer and use it in GitHub Desktop.
Docker
FROM php:7.3-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
@jpswade
Copy link
Author

jpswade commented Nov 1, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment