FROM ubuntu:14.04

# Update package list and install required packages
RUN apt-get update && \
    apt-get install -y apache2 php5 libapache2-mod-php5 php5-mysql

# Set up document root for apache
ENV APACHE_DOCUMENT_ROOT /var/www/html

# Enable apache mods
RUN a2enmod rewrite

# Update the default apache site with the configuration we created
COPY apache-config.conf /etc/apache2/sites-available/000-default.conf

RUN mkdir -p /var/run/apache2 /var/log/apache2

# Expose ports
EXPOSE 80

# Start apache in foreground
CMD ["apache2", "-D", "FOREGROUND"]