Authored by 陈峰

merge

... ... @@ -152,3 +152,5 @@ nbproject/*
/scripts/*
apps/api/controllers/excel.js
public/docs/*
*.tar.gz
... ...
phantomjs_cdnurl=http://npm.taobao.org/mirrors/phantomjs
registry=http://npm.yoho.cn
\ No newline at end of file
registry=http://npm.yoho.cn
sass_binary_site=http://npm.taobao.org/mirrors/node-sass
... ...
############################################################
# Dockerfile to build hystrix + turbin Installed Containers
# Based on centos 6.7
# How to build new image: docker build -t yoho-hystrix-qcloud .
# the hystrix alert need to post events to influxdb.yohoops.org.
# nginx version: 1.12.0
############################################################
#base image : ccr.ccs.tencentyun.com/yoho-base/nodejs
FROM ccr.ccs.tencentyun.com/yoho-base/nodejs
MAINTAINER feng.chen <feng.chen@yoho.cn>
ENV NODE_ENV=production \
NODE_HOME=/home
COPY yoho-activity-platform.tar.gz /home
RUN cd /home && \
mkdir -p /home/yoho-activity-platform && \
mkdir -p /Data/log/yoho-activity-platform && \
tar -xzvf yoho-activity-platform.tar.gz -C /home/yoho-activity-platform && \
rm -rf yoho-activity-platform.tar.gz
WORKDIR /home/yoho-activity-platform
#expose port
EXPOSE 6006
CMD ["node","/home/yoho-activity-platform/app.js"]
\ No newline at end of file
... ...
## this is docker file
\ No newline at end of file
... ... @@ -85,6 +85,11 @@ try {
app.use(devtools());
}
// docker验证项目是否正常发布
app.use('/node/status.html', (req, res) => {
return res.status(204).end();
});
require('./dispatch')(app);
app.all('*', errorHandler.notFound); // 404
... ...
... ... @@ -39,18 +39,17 @@ module.exports = {
interfaceShunt: {
open: false
},
loggers: {
loggers: {
infoFile: {
close: true,
name: 'info',
level: 'error',
filename: 'logs/info.log',
level: 'info',
filename: '/Data/log/yoho-activity-platform/info.log',
maxFiles: 7
},
errorFile: {
name: 'error',
level: 'error',
filename: 'logs/error.log',
filename: '/Data/log/yoho-activity-platform/error.log',
handleExceptions: true,
maxFiles: 7
},
... ...
#!/bin/bash
wordir=$2
cd $wordir
rm -rf yoho-activity-platform.tar.gz
if [[ $1 == "TEST1" ]] || [[ $1 == "TEST2" ]] || [[ $1 == "TEST3" ]]
then
NODE_ENV='test'
elif [[ $1 == "GRAY-QCLOUD" ]]
then
NODE_ENV='gray'
elif [[ $1 == "ONLINE-AWS" ]] || [[ $1 == "ONLINE-QCLOUD" ]]
then
NODE_ENV='production'
fi
yarn
NODE_ENV=development yarn
yarn build
tar -czvf yoho-activity-platform.tar.gz *
... ...