Skip to content

Instantly share code, notes, and snippets.

@nirbhabbarat
Forked from jpswade/Dockerfile-php73
Created November 1, 2020 10:08
Show Gist options
  • Save nirbhabbarat/1c130e10b82d00d8b8a98ffddb819fa4 to your computer and use it in GitHub Desktop.
Save nirbhabbarat/1c130e10b82d00d8b8a98ffddb819fa4 to your computer and use it in GitHub Desktop.
Docker
FROM php:7.3-apache
MAINTAINER James Wade <jpswade@gmail.com>
# 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