目录
Dockerfile实战
基础pm2 Dockerfile
keymetrics/pm2:8-alpine
keymetrics/pm2:12-alpine
FROM pm2:8-alpine
COPY ./Shanghai /etc/localtime
RUN mkdir -p /data/logs/pm2 && apk add curl wget
pm2 node Dockerfile
FROM harbor.qing.cn/base/pm2:8-alpine-v2
#RUN apk add --no-cache tzdata
#ENV TZ Asia/Shanghai
#/usr/share/zoneinfo/Asia/Shanghai /etc/localtime
#RUN dpkg-reconfigure -f noninteractive tzdata
COPY . /usr/local/src
#RUN echo 'Asia/Shanghai' >/etc/timezone
WORKDIR /usr/local/src
#RUN mkdir /data/logs/pm2 -p
EXPOSE docker_port
CMD pm2-docker start ecosystem.config.js --env test
nginx Dockerfile
FROM nginx:1.14.0
COPY ./Shanghai /etc/localtime
RUN mkdir -p /usr/local/nginx/html && mkdir -p /data/wwwlogs && chown nginx. /data/wwwlogs -R && apt-get update && apt-get install -y curl wget telnet vim procps unzip
COPY index.html /usr/local/nginx/html/
COPY nginx.conf /etc/nginx/nginx.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
nginx php-fpm Dockerfile
java Dockerfile
FROM docker-registry.qing.com/base/tomcat_base:v1
RUN mkdir -p /data/appdatas
RUN mkdir -p /data/appdatas/wcc
RUN mkdir -p /data/log/tomcat
COPY ./logging.properties /usr/local/tomcat/conf/
COPY ./server.xml /usr/local/tomcat/conf/
COPY ./catalina.sh /usr/local/tomcat/bin/
COPY ./ROOT.war /usr/local/tomcat/webapps/
COPY ./config_env.ini /data/appdatas/wcc/
WORKDIR /usr/local/tomcat
EXPOSE 8080
jdk Dockerfile
FROM centos:7
ADD jdk1.8.0_181.tar /usr/local/
ENV JAVA_HOME /usr/local/jdk1.8.0_181
ENV JRE_HOME ${JAVA_HOME}/jre
ENV CLASSPATH ${JAVA_HOME}/lib:${JRE_HOME}/lib
ENV PATH $PATH:$JAVA_HOME/bin
** 业务 Dockerfile **
FROM xxx.qing/base/jdk:1.8-v2
ENV app_jar irsapi.jar
ENV app_port 80
RUN mkdir -p /opt/{app,logs,settings}
WORKDIR /opt/app
ADD irs-server/target/${app_jar} /opt/app/${app_jar}
EXPOSE ${app_port}
##CMD java -Djava.security.egd=file:/dev/./urandom -jar ${app_jar} --spring.profiles.active=test
CMD java -jar -Duser.timezone=GMT+08 ${app_jar}