Skip to content

Instantly share code, notes, and snippets.

@astrolox
Created February 17, 2016 11:32
Show Gist options
  • Save astrolox/00ca9fcad9708fd665b6 to your computer and use it in GitHub Desktop.
Save astrolox/00ca9fcad9708fd665b6 to your computer and use it in GitHub Desktop.
FROM php:7.0-apache
# Enable rewrite
RUN a2enmod rewrite
# Enable php extensions
RUN apt-get update && apt-get install -y \
libfreetype6-dev \
libjpeg62-turbo-dev \
libmcrypt-dev \
libpng12-dev \
&& docker-php-ext-install -j$(nproc) zip iconv mcrypt mbstring json pdo \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
&& docker-php-ext-install -j$(nproc) gd \
&& rm -rf /var/lib/apt/lists/*
# Change Apache2 document root
RUN sed -i.bak -e 's@DocumentRoot /var/www/html@DocumentRoot /var/www/html/public@g' /etc/apache2/apache2.conf
# Use custom PHP configuration
COPY config/php.ini /usr/local/etc/php/
# TODO step 2 - uncomment this
# COPY src/ /var/www/html/
# TODO step 1 - remove everything below this .... note, leaving this in requires --privileged to work
# Install git
RUN apt-get update && apt-get install -y \
git \
&& rm -rf /var/lib/apt/lists/*
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
RUN composer global require "laravel/installer"
RUN apt-get update -y && apt-get install bindfs -y && rm -rf /var/lib/apt/lists/*
RUN echo "#!/bin/sh" > /start.sh && \
echo "bindfs -u www-data -g www-data /mnt /var/www/html && apache2-foreground" >> /start.sh && \
chmod 777 /start.sh
CMD ["/start.sh"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment