diff --git a/Dockerfile b/Dockerfile index e022ec58..3ea32245 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,25 +4,25 @@ MAINTAINER Fernando Mayo , Feng Honglin # Install packages ENV DEBIAN_FRONTEND noninteractive RUN apt-get update && \ - apt-get -y install supervisor git apache2 libapache2-mod-php5 mysql-server php5-mysql pwgen php-apc php5-mcrypt && \ - echo "ServerName localhost" >> /etc/apache2/apache2.conf + apt-get -y install supervisor git apache2 libapache2-mod-php5 mysql-server php5-mysql pwgen php-apc php5-mcrypt php5-gd && \ + php5enmod mcrypt && \ + echo "ServerName localhost" >> /etc/apache2/apache2.conf -# Add image configuration and scripts +# Remove pre-installed database +RUN rm -rf /var/lib/mysql/* + +# Add scripts +ADD run.sh /run.sh ADD start-apache2.sh /start-apache2.sh ADD start-mysqld.sh /start-mysqld.sh -ADD run.sh /run.sh +ADD create_mysql_admin_user.sh /create_mysql_admin_user.sh RUN chmod 755 /*.sh + +# Add config files ADD my.cnf /etc/mysql/conf.d/my.cnf ADD supervisord-apache2.conf /etc/supervisor/conf.d/supervisord-apache2.conf ADD supervisord-mysqld.conf /etc/supervisor/conf.d/supervisord-mysqld.conf -# Remove pre-installed database -RUN rm -rf /var/lib/mysql/* - -# Add MySQL utils -ADD create_mysql_admin_user.sh /create_mysql_admin_user.sh -RUN chmod 755 /*.sh - # config to enable .htaccess ADD apache_default /etc/apache2/sites-available/000-default.conf RUN a2enmod rewrite @@ -35,8 +35,5 @@ RUN mkdir -p /app && rm -fr /var/www/html && ln -s /app /var/www/html ENV PHP_UPLOAD_MAX_FILESIZE 10M ENV PHP_POST_MAX_SIZE 10M -# Add volumes for MySQL -VOLUME ["/etc/mysql", "/var/lib/mysql" ] - EXPOSE 80 3306 CMD ["/run.sh"] diff --git a/LICENSE b/LICENSE index e06d2081..b88de053 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ + Version 2.0, January 2004 + http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..a5783582 --- /dev/null +++ b/Makefile @@ -0,0 +1,10 @@ +IMAGE=moorara/lamp +VERSION=latest + +build: + docker build -t $(IMAGE):$(VERSION) . + +run: + docker run -d -p 80:80 -p 3306:3306 $(IMAGE):$(VERSION) + +.PHONY: build run diff --git a/apache_default b/apache_default index 01ba4e90..e0b514f9 100644 --- a/apache_default +++ b/apache_default @@ -24,15 +24,12 @@ ErrorLog ${APACHE_LOG_DIR}/error.log - # Possible values include: debug, info, notice, warn, error, crit, - # alert, emerg. + # Possible values include: debug, info, notice, warn, error, crit, alert, emerg. LogLevel warn CustomLog ${APACHE_LOG_DIR}/access.log combined - # - # Set HTTPS environment variable if we came in over secure - # channel. - SetEnvIf x-forwarded-proto https HTTPS=on + # Set HTTPS environment variable if we came in over secure channel. + SetEnvIf x-forwarded-proto https HTTPS=on diff --git a/tutum.yml b/tutum.yml deleted file mode 100644 index 37029b74..00000000 --- a/tutum.yml +++ /dev/null @@ -1,6 +0,0 @@ -lamp: - image: tutum/lamp - ports: - - 80:80 - - 3306:3306 -