Authored by 陈峰

docker

############################################################
# 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 yohobuy-node.tar.gz /home
RUN cd /home && \
mkdir -p /home/yohobuy-node && \
mkdir -p /Data/log/yohobuy-node && \
tar -xzvf yohobuy-node.tar.gz -C /home/yohobuy-node && \
rm -rf yohobuy-node.tar.gz
WORKDIR /home/yohobuy-node
#expose port
EXPOSE 6002
CMD ["node","/home/yohobuy-node/app.js"]
\ No newline at end of file
... ...
... ... @@ -164,6 +164,10 @@ try {
require('./dispatch')(app);
app.use('/crm/common/ok.jsp', (req, res) => {
res.status(204).end();
});
app.all('*', errorHandler.notFound()); // 404
// YOHO 后置中间件
... ...
rm -rf yohobuy-node.tar.gz
yarn
if [[ $1 == "TEST1" ]] || [[ $1 == "TEST2" ]] || [[ $1 == "TEST3" ]]
then
yarn build
fi
tar -czvf yohobuy-node.tar.gz *
\ No newline at end of file
... ...