Skip to content
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

support docker deploy #11

Merged
merged 2 commits into from Oct 29, 2016
Merged

support docker deploy #11

merged 2 commits into from Oct 29, 2016

Conversation

guyskk
Copy link
Collaborator

@guyskk guyskk commented Oct 28, 2016

配置 config.py

DATABASE_URI = 'mysql://root:root@mysql/git_webhook'

CELERY_BROKER_URL = 'redis://:@redis:6379/0'
CELERY_RESULT_BACKEND = 'redis://:@redis:6379/0'

部署,第一次构建可能需要几分钟或十几分钟

docker-compose -f docker-compose-dev.yml up

完成后访问 http://127.0.0.1:18340/

TODO

  • 保存celery日志
  • config.py也许可以不用配置MySQL和Redis,因为在容器里都是固定的,容器外也访问不到

@hustcc
Copy link
Member

hustcc commented Oct 28, 2016

👍🏻非常赞,这个在你本地是跑起来没问题吧?

  1. gunicorn bind 应该是 18340 端口吧?
  2. gunicorn启动加一个 -k gevent 参数吧,项目实例网站是这么启动的。
  3. 可以再加一个 docker 部署文档(非常详细的)吗?可以直接在 readme 的部署那里加一个链接…

非常感谢(´▽`ʃƪ)

@guyskk
Copy link
Collaborator Author

guyskk commented Oct 28, 2016

我本地运行没问题。
gunicorn绑定的80端口,再通过docker绑定宿主机的18340端口。
2,3明天可以加上。

docker-compose.yml目前是不能用的,需要你通过Dockerfile构建一个镜像并上传到docker hub之后才能用。

docker-compose-dev.yml是调试用的,你遇到什么问题了?

@hustcc
Copy link
Member

hustcc commented Oct 28, 2016

我之前没有实际用过docker?所以希望能有详细的使用部署文档。

我明天把你加入到项目吧(^ω^)

@guyskk
Copy link
Collaborator Author

guyskk commented Oct 29, 2016

我加上了文档,改用了更简单的部署方式。
https://github.com/ncuhome/git-webhook/blob/master/deploy-docker.md

@hustcc hustcc merged commit 2de6b2b into NetEaseGame:master Oct 29, 2016
@hustcc
Copy link
Member

hustcc commented Oct 29, 2016

感谢,我现在手机操作merge的,有时间我按照你写的文档试试😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants