Skip to content
This repository has been archived by the owner on Nov 29, 2020. It is now read-only.

Remove volumes and keep mysql completely inside container #42

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 11 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,25 @@ MAINTAINER Fernando Mayo <[email protected]>, Feng Honglin <[email protected]>
# 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
Expand All @@ -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"]
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -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

Expand Down
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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
9 changes: 3 additions & 6 deletions apache_default
Original file line number Diff line number Diff line change
Expand Up @@ -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

</VirtualHost>
6 changes: 0 additions & 6 deletions tutum.yml

This file was deleted.