Showing
7 changed files
with
61 additions
and
7 deletions
Dockerfile
0 → 100644
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"] |
Dockfile
deleted
100644 → 0
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 | }, |
docker.sh
0 → 100644
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 * |
-
Please register or login to post a comment