Docker + CentOS7 + LAMP 镜像
FROM centos:centos7
MAINTAINER Shen Gang <gang.shen@chivox.com>
ADD ./scripts /home/scripts
# install http
RUN rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
# install httpd
RUN yum -y install httpd vim-enhanced bash-completion unzip
RUN sed -i 's/#ServerName www.example.com:80/ServerName localhost:80/g' /etc/httpd/conf/httpd.conf
# install mysql
RUN yum install -y mysql mysql-server
RUN echo "NETWORKING=yes" > /etc/sysconfig/network
RUN yes | cp /home/scripts/my.cnf /etc/
RUN /home/scripts/init.sh
# install php
RUN yum install -y php php-mysql php-devel php-gd php-pecl-memcache php-pspell php-snmp php-xmlrpc php-xml
# install supervisord
RUN yum install -y python-pip && pip install "pip>=1.4,<1.5" --upgrade
RUN pip install supervisor
# install sshd
RUN yum install -y openssh-server openssh-clients passwd
RUN ssh-keygen -q -N "" -t dsa -f /etc/ssh/ssh_host_dsa_key && ssh-keygen -q -N "" -t rsa -f /etc/ssh/ssh_host_rsa_key
RUN sed -ri 's/UsePAM yes/UsePAM no/g' /etc/ssh/sshd_config && echo 'root:changeme' | chpasswd
RUN sed -ri 's/DirectoryIndex/DirectoryIndex web\/stuLogin.php/g' /etc/httpd/conf/httpd.conf
ADD ./webapp /var/www/html/
RUN chmod -R 777 /var/www/html/
ADD supervisord.conf /etc/
EXPOSE 22 80 3306
CMD ["supervisord", "-n"]