File tree Expand file tree Collapse file tree 4 files changed +69
-8
lines changed
Expand file tree Collapse file tree 4 files changed +69
-8
lines changed Original file line number Diff line number Diff line change @@ -73,6 +73,59 @@ $ npm start
7373$ npm stop
7474```
7575
76+ #### Deploy with docker
77+ Setup redis / mongodb / egg-cnode, requirements:
78+
79+ - docker
80+ - docker-compose
81+
82+ ** Modify Github Id/Secret**
83+
84+ ``` yml
85+ version : ' 3'
86+ services :
87+ cnode :
88+ environment :
89+ - EGG_PASSPORT_GITHUB_CLIENT_ID=test
90+ - EGG_PASSPORT_GITHUB_CLIENT_SECRET=test
91+ ` ` `
92+
93+ **Modify Alinode AppId/Secret**
94+
95+ ` ` ` yml
96+ version : ' 3'
97+ services :
98+ cnode :
99+ environment :
100+ - EGG_ALINODE_APPID=appid
101+ - EGG_ALINODE_SECRET=secret
102+ ` ` `
103+
104+ > to disable alinode, modify config/plugin.prod.js
105+
106+ **Change Port**
107+
108+ ` ` ` yml
109+ version : ' 3'
110+ services :
111+ cnode :
112+ ports :
113+ - ${PORT}:7001
114+ ` ` `
115+
116+ **Run / Stop**
117+
118+ ` ` ` bash
119+ # start
120+ docker-compose up -d
121+
122+ # stop
123+ docker-compose down
124+
125+ # remove volume/cache
126+ docker-compose down -v
127+ ```
128+
76129### npm scripts
77130
78131- Use ` npm run lint ` to check code style.
Original file line number Diff line number Diff line change @@ -131,10 +131,10 @@ module.exports = appInfo => {
131131 ignoreTLS : true ,
132132 } ;
133133
134- exports . alinode = {
135- enable : true ,
136- appid : '' ,
137- secret : '' ,
134+ config . alinode = {
135+ // 从 `Node.js 性能平台` 获取对应的接入参数
136+ appid : process . env . EGG_ALINODE_APPID || '' ,
137+ secret : process . env . EGG_ALINODE_SECRET || '' ,
138138 } ;
139139
140140 return config ;
Original file line number Diff line number Diff line change 1+ 'use strict' ;
2+
3+ exports . alinode = {
4+ enable : true ,
5+ package : 'egg-alinode' ,
6+ } ;
Original file line number Diff line number Diff line change @@ -16,6 +16,8 @@ services:
1616 - EGG_MONGODB_URL=mongodb://egg_cnode:egg_cnode@mongodb:27017/egg_cnode
1717 - EGG_PASSPORT_GITHUB_CLIENT_ID=test
1818 - EGG_PASSPORT_GITHUB_CLIENT_SECRET=test
19+ - EGG_ALINODE_APPID=appid
20+ - EGG_ALINODE_SECRET=secret
1921 depends_on :
2022 - redis
2123 - mongodb
@@ -31,8 +33,8 @@ services:
3133 - egg-redis:/data
3234 networks :
3335 - docker_cnode
34- ports :
35- - 6379:6379
36+ # ports:
37+ # - 6379:6379
3638
3739 mongodb :
3840 image : mongo:3.2
@@ -46,8 +48,8 @@ services:
4648 - ./init.d/mongo:/docker-entrypoint-initdb.d
4749 networks :
4850 - docker_cnode
49- ports :
50- - 27017:27017
51+ # ports:
52+ # - 27017:27017
5153
5254volumes :
5355 egg-mongo :
You can’t perform that action at this time.
0 commit comments