Authored by 陈峰

Merge branch 'feature/docker' into 'gray'

Feature/docker



See merge request !90
############################################################
# 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:8.9.1
FROM ccr.ccs.tencentyun.com/yoho-base/nodejs:8.9.1
MAINTAINER feng.chen <feng.chen@yoho.cn>
ENV NODE_ENV=production \
NODE_HOME=/home
COPY yoho-shop-manage.tar.gz /home
RUN cd /home && \
mkdir -p /home/yoho-shop-manage && \
mkdir -p /Data/log/yoho-shop-manage && \
tar -xzf yoho-shop-manage.tar.gz -C /home/yoho-shop-manage && \
rm -rf yoho-shop-manage.tar.gz
WORKDIR /home/yoho-shop-manage
#expose port
EXPOSE 6007
CMD ["node","/home/yoho-shop-manage/server/app.js"]
... ...
#!/bin/bash
wordir=$2
cd $wordir
rm -rf yoho-shop-manage.tar.gz
yarn
if [[ $1 == "TEST1" ]] || [[ $1 == "TEST2" ]] || [[ $1 == "TEST3" ]]
then
yarn build
fi
tar -czf yoho-shop-manage.tar.gz *
\ No newline at end of file
... ...
... ... @@ -56,6 +56,10 @@ app.use(multipartMiddleware);
const middleware = require('./middleware');
const controllers = require('./controllers');
app.use('/crm/common/ok.jsp', (req, res) => {
res.status(204).end();
});
try {
app.use(middleware.main);
... ...
... ... @@ -146,7 +146,7 @@ if (global.env.Test) {
if (global.env.Production) {
domains.erp = 'http://gateway.erp.yohoops.org';
domains.platform = 'http://api.platform.yohoops.org/platform';
domains.shop = 'http://127.0.0.1:30016';
domains.shop = 'http://10.66.50.140:30016';
}
_.each(domainApis, (apis, domainName) => {
... ...
... ... @@ -20,20 +20,20 @@ const config = {
apiDomain: apiDomain,
loggers: {
infoFile: {
close: true,
name: 'info',
level: 'error',
filename: 'logs/info.log',
level: 'info',
filename: '/Data/logs/yoho-shop-manage/info.log',
maxFiles: 7
},
errorFile: {
name: 'error',
level: 'error',
filename: 'logs/error.log',
filename: '/Data/logs/yoho-shop-manage/error.log',
handleExceptions: true,
maxFiles: 7
},
console: {
close: true,
level: 'info',
colorize: 'all',
prettyPrint: true
... ...