Authored by 陈峰

merge

@@ -152,3 +152,5 @@ nbproject/* @@ -152,3 +152,5 @@ nbproject/*
152 /scripts/* 152 /scripts/*
153 apps/api/controllers/excel.js 153 apps/api/controllers/excel.js
154 public/docs/* 154 public/docs/*
  155 +
  156 +*.tar.gz
1 phantomjs_cdnurl=http://npm.taobao.org/mirrors/phantomjs 1 phantomjs_cdnurl=http://npm.taobao.org/mirrors/phantomjs
2 -registry=http://npm.yoho.cn  
  2 +registry=http://npm.yoho.cn
  3 +sass_binary_site=http://npm.taobao.org/mirrors/node-sass
  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  
@@ -85,6 +85,11 @@ try { @@ -85,6 +85,11 @@ try {
85 app.use(devtools()); 85 app.use(devtools());
86 } 86 }
87 87
  88 + // docker验证项目是否正常发布
  89 + app.use('/node/status.html', (req, res) => {
  90 + return res.status(204).end();
  91 + });
  92 +
88 require('./dispatch')(app); 93 require('./dispatch')(app);
89 app.all('*', errorHandler.notFound); // 404 94 app.all('*', errorHandler.notFound); // 404
90 95
@@ -39,18 +39,17 @@ module.exports = { @@ -39,18 +39,17 @@ module.exports = {
39 interfaceShunt: { 39 interfaceShunt: {
40 open: false 40 open: false
41 }, 41 },
42 - loggers: { 42 + loggers: {
43 infoFile: { 43 infoFile: {
44 - close: true,  
45 name: 'info', 44 name: 'info',
46 - level: 'error',  
47 - filename: 'logs/info.log', 45 + level: 'info',
  46 + filename: '/Data/log/yoho-activity-platform/info.log',
48 maxFiles: 7 47 maxFiles: 7
49 }, 48 },
50 errorFile: { 49 errorFile: {
51 name: 'error', 50 name: 'error',
52 level: 'error', 51 level: 'error',
53 - filename: 'logs/error.log', 52 + filename: '/Data/log/yoho-activity-platform/error.log',
54 handleExceptions: true, 53 handleExceptions: true,
55 maxFiles: 7 54 maxFiles: 7
56 }, 55 },
  1 +#!/bin/bash
  2 +wordir=$2
  3 +cd $wordir
  4 +rm -rf yoho-activity-platform.tar.gz
  5 +if [[ $1 == "TEST1" ]] || [[ $1 == "TEST2" ]] || [[ $1 == "TEST3" ]]
  6 +then
  7 + NODE_ENV='test'
  8 +elif [[ $1 == "GRAY-QCLOUD" ]]
  9 +then
  10 + NODE_ENV='gray'
  11 +elif [[ $1 == "ONLINE-AWS" ]] || [[ $1 == "ONLINE-QCLOUD" ]]
  12 +then
  13 + NODE_ENV='production'
  14 +fi
  15 +yarn
  16 +NODE_ENV=development yarn
  17 +yarn build
  18 +tar -czvf yoho-activity-platform.tar.gz *