Authored by 陈峰

docker

  1 +############################################################
  2 +# Dockerfile to build hystrix + turbin Installed Containers
  3 +# Based on centos 6.7
  4 +# How to build new image: docker build -t yoho-hystrix-qcloud .
  5 +# the hystrix alert need to post events to influxdb.yohoops.org.
  6 +# nginx version: 1.12.0
  7 +############################################################
  8 +
  9 +#base image : ccr.ccs.tencentyun.com/yoho-base/nodejs
  10 +FROM ccr.ccs.tencentyun.com/yoho-base/nodejs
  11 +
  12 +MAINTAINER feng.chen <feng.chen@yoho.cn>
  13 +
  14 +ENV NODE_ENV=production \
  15 + NODE_HOME=/home
  16 +
  17 +COPY yoho-activity-platform.tar.gz /home
  18 +
  19 +RUN cd /home && \
  20 + mkdir -p /home/yoho-activity-platform && \
  21 + mkdir -p /Data/log/yoho-activity-platform && \
  22 + tar -xzvf yoho-activity-platform.tar.gz -C /home/yoho-activity-platform && \
  23 + rm -rf yoho-activity-platform.tar.gz
  24 +
  25 +WORKDIR /home/yoho-activity-platform
  26 +
  27 +#expose port
  28 +EXPOSE 6006
  29 +
  30 +CMD ["node","/home/yoho-activity-platform/app.js"]
1 -## this is docker file  
  1 +rm -rf yoho-activity-platform.tar.gz
  2 +if [[ $1 == "TEST1" ]] || [[ $1 == "TEST2" ]] || [[ $1 == "TEST3" ]]
  3 +then
  4 + NODE_ENV='test'
  5 +elif [[ $1 == "GRAY-QCLOUD" ]]
  6 +then
  7 + NODE_ENV='gray'
  8 +elif [[ $1 == "ONLINE-AWS" ]] || [[ $1 == "ONLINE-QCLOUD" ]]
  9 +then
  10 + NODE_ENV='production'
  11 +fi
  12 +yarn
  13 +yarn build
  14 +tar -czvf yoho-activity-platform.tar.gz *