FROM centos
MAINTAINER Jokertomcat:one
RUN yum -y install gcc automake autoconf libtool make unzip vim
ENV LANG en_US.UTF-8
#安装Lua
COPY ./LuaJIT-2.0.4.tar.gz /db/java/
RUN tar zxvf /db/java/LuaJIT-2.0.4.tar.gz -C /db/java/
WORKDIR /db/java/LuaJIT-2.0.4
RUN make && make install
WORKDIR /db/java/
RUN rm -rf ./LuaJIT-2.0.4
ENV SERVERIP 120.27.138.219
ENV LUAJIT_LIB /usr/local/lib
ENV LUAJIT_INC /usr/local/include/luajit-2.0
ENV LD_LIBRARY_PATH /usr/local/lib/:$LD_LIBRARY_PATH
#安装LuaJIT完毕
#开始安装tomcat
COPY ./apache-tomcat-8.0.24.tar.gz /db/java/tomcat/
RUN tar zxvf /db/java/tomcat/apache-tomcat-8.0.24.tar.gz -C /db/java/tomcat/
#配置tomcat
COPY ./tomcatConfig/ /db/java/tomcat/apache-tomcat-8.0.24/
RUN rm -rf /db/java/tomcat/apache-tomcat-8.0.24.tar.gz
#开始安装jdk
COPY ./jdk-8u60-linux-x64.gz /db/java/jdk/
RUN tar zxvf /db/java/jdk/jdk-8u60-linux-x64.gz -C /db/java/jdk
RUN rm -rf /db/java/jdk/jdk-8u60-linux-x64.gz
ENV JAVA_HOME /db/java/jdk/jdk1.8.0_60
ENV PATH $JAVA_HOME/bin:$PATH
ENV CLASSPATH .:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
EXPOSE 8009
EXPOSE 8080
#下载并准备安装nginx
WORKDIR /db/java/nginx/
COPY ./nginx-1.9.4.tar.gz /db/java/nginx/
RUN tar zxvf /db/java/nginx/nginx-1.9.4.tar.gz -C /db/java/nginx/
COPY ./ngx_devel_kit-master.zip /db/java/nginx/
RUN unzip ./ngx_devel_kit-master.zip
COPY ./lua-nginx-module-master.zip /db/java/nginx/
RUN unzip ./lua-nginx-module-master.zip
RUN rm -rf ngx_devel_kit-master.zip lua-nginx-module-master.zip
#COPY ./nginxConfig/ /usr/local/nginx/conf/
WORKDIR /db/java/nginx/nginx-1.9.4
RUN yum -y install pcre-devel openssl openssl-devel
RUN mkdir /usr/local/nginx
RUN ./configure --prefix=/usr/local/nginx --add-module=/db/java/nginx/lua-nginx-module-master --add-module=/db/java/nginx/ngx_devel_kit-master
RUN make -j2 && make install
COPY ./nginxConfig/ /usr/local/nginx/conf/
WORKDIR /db/java/tomcat/apache-tomcat-8.0.24/
RUN mkdir -p /db/java/temp/manager
#项目更新程序存放
COPY ./updateManager/ /db/java/updateManager
VOLUME /db/java/updateManager/
WORKDIR /db/java/updateManager/
VOLUME /db/java/updateManager/
CMD sh /db/java/tomcat/apache-tomcat-8.0.24/bin/startup.sh && tail -f /db/java/tomcat/apache-tomcat-8.0.24/logs/catalina.out
docker run -p 80:80 -p 3366:3366 -e TZ=Asia/Shanghai -e SERVERIP=120.27.138.219 -v /db/java/tomcat1/:/db/java/tomcat1/ -v /db/java/temp:/db/java/temp/ -v /db/java/tomcat3/webapps/:/db/java/tomcat/apache-tomcat-8.0.24/webapps/ -v /db/java/tomcat1/LOGS/Manager/:/db/java/tomcat1/LOGS/Manager/ -v /db/java/config/:/db/java/config/ -v /etc/localtime:/etc/localtime joker:five