FROM debian:stable
MAINTAINER n00dl3 "julien.durens@linkeo.com"
ENV DEBIAN_FRONTEND noninteractive

ADD bootstrap.sh /root/bootstrap.sh

RUN apt-get update && apt-get install -y apache2 php5 php5-mysql php5-xdebug  php5-gd php5-curl

ADD 001-storelocator.conf /etc/apache2/sites-available/
ADD 20-xdebug.ini /etc/php5/conf.d/20-xdebug.ini
RUN chmod +x /root/bootstrap.sh
RUN ln -s /etc/apache2/sites-available/001-storelocator.conf /etc/apache2/sites-enabled/
RUN a2dissite default
RUN a2enmod rewrite

ENV APACHE_RUN_USER www-data
ENV APACHE_RUN_GROUP www-data
ENV APACHE_LOG_DIR /var/log/apache2
ENV APACHE_PID_FILE /var/run/apache2.pid
ENV APACHE_RUN_DIR /var/run/apache2
ENV APACHE_LOCK_DIR /var/lock/apache2
ENV APACHE_SERVERADMIN admin@localhost
ENV APACHE_SERVERNAME localhost
ENV APACHE_SERVERALIAS docker.localhost
ENV APACHE_DOCUMENTROOT /var/www

EXPOSE 80

ENTRYPOINT /root/bootstrap.sh

