-
Notifications
You must be signed in to change notification settings - Fork 285
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: docker support #38
Conversation
Codecov Report
@@ Coverage Diff @@
## master #38 +/- ##
=======================================
Coverage 59.17% 59.17%
=======================================
Files 34 33 -1
Lines 926 926
=======================================
Hits 548 548
Misses 378 378
Continue to review full report at Codecov.
|
config/config.prod.js
Outdated
|
||
exports.redis = { | ||
client: { | ||
host: process.env.EGG_REDIS_HOST || '127.0.0.1', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
有 prod 的话,unittest 和 local 里面的配置,可以考虑写到 default 去
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不过都有环境变量了,那是不是 prod 也不需要了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
还是不要搞那么多环境变量吧,弄个配置文件更好。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这边的加 prod 的原因写在 Dockerfile 的 review 里了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue #28 讨论吧
init.d/mongo/init.js
Outdated
}) | ||
|
||
db.egg_cnode.insert({ | ||
'cnode': 'egg-cnode' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cnode
没有''
- 这个文件可以不用 ignore 掉 eslint 的,在顶部加一句注释,加个
/* global db */
就 ok 了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👌, 加了 /* eslint-disable */
|
||
# RUN npm i --production | ||
|
||
RUN npm i --production --registry=https://registry.npm.taobao.org |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我的想法是,本地开发给一个 docker 来启动数据库等环境,本地应该不需要在 docker 里面复制源码和 npm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
唔,感觉可以加一个 compose 配置:
- docker-compose.yml 启动一个基本和正式环境完全一致的服务(egg/redis/mongo)
- docker-compose-dev.yml 启动数据库等
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我觉得 docker 支持作为另一个 repo 吧。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我现在的需求很简单,要提供开发期支持,不然本地 egg-bin test
的时候,要自己启动 redis 和 mongo
部署这个暂时不关心
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
加了一个 docker-compose.dev.yml 来启动数据库
rebase |
@atian25 唔,配置这边有点改动, |
…g-cnode into feature-docker
没有rebase 对吧。 |
…g-cnode into feature-docker
Checklist
npm test
passesAffected core subsystem(s)
Description of change