FROM ubuntu:16.04
MAINTAINER qwe
RUN apt-get update
RUN apt-get -y upgrade
# Install PHP 7 and some common extensions
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y php php-imagick php-fpm php-mcrypt php-mysql php-gd php-dev php-xdebug php-curl php-intl php-zip php-mbstring php-soap
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install apache2
# Configure Apache
RUN DEBIAN_FRONTEND=noninteractive a2enmod rewrite && service apache2 restart
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install mysql-server mysql-client php-mysql libapache2-mod-php
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install curl php-cli php-mbstring git unzip
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install libmysqlclient-dev
RUN DEBIAN_FRONTEND=noninteractive curl -sS
https://getcomposer.org/installer -o composer-setup.php
RUN DEBIAN_FRONTEND=noninteractive php composer-setup.php --install-dir=/usr/local/bin --filename=composer
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install phpunit
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install iptables
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install wget telnet mc
ENV APACHE_RUN_USER www-data
ENV APACHE_RUN_GROUP www-data
ENV APACHE_LOG_DIR /var/log/apache2
RUN chown -R www-data:www-data /var/www/
RUN service mysql stop
RUN mkdir '/run/mysqld'
RUN chown -R mysql /var/run/mysqld
RUN /usr/sbin/mysqld --skip-grant-tables --skip-networking &
RUN mysql -u root
RUN FLUSH PRIVILEGES
EXPOSE 8080
#CMD apachectl -DFOREGROUND