{"id":21731341,"url":"https://github.com/ymm-tech/gods-pen-docker","last_synced_at":"2025-03-20T23:41:44.299Z","repository":{"id":71117750,"uuid":"187948000","full_name":"ymm-tech/gods-pen-docker","owner":"ymm-tech","description":"码良docker部署","archived":false,"fork":false,"pushed_at":"2020-04-28T11:25:33.000Z","size":55,"stargazers_count":90,"open_issues_count":4,"forks_count":51,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-01-25T20:24:13.470Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Makefile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ymm-tech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-05-22T02:28:46.000Z","updated_at":"2025-01-08T02:05:09.000Z","dependencies_parsed_at":"2023-04-11T08:17:06.320Z","dependency_job_id":null,"html_url":"https://github.com/ymm-tech/gods-pen-docker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ymm-tech%2Fgods-pen-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ymm-tech%2Fgods-pen-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ymm-tech%2Fgods-pen-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ymm-tech%2Fgods-pen-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ymm-tech","download_url":"https://codeload.github.com/ymm-tech/gods-pen-docker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244711946,"owners_count":20497417,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-26T04:24:13.038Z","updated_at":"2025-03-20T23:41:44.239Z","avatar_url":"https://github.com/ymm-tech.png","language":"Makefile","funding_links":[],"categories":["Makefile"],"sub_categories":[],"readme":"# godspen On-Premise\n\n## WHAT\n\n本项目提供了 码良 的私有部署（On-Premise）。基于 docker 及 docker-compose，部署你自己的 码良 服务。\n\n码良 依赖 es、redis、mysql、邮件、oss服务，其中 es、redis、mysql 默认由docker容器提供，见 docker-compose.yaml。\n\n## 视频教程\n[点击前往](https://www.bilibili.com/video/av82434809/)\n\n## HOW\n\n### 必要条件\n\n- linux 系统或其他 linux 发行版 [推荐阿里云上购买服务器](https://www.aliyun.com/product/ecs?aly_as=P6zVCnft\u0026source=5176.11533457\u0026userCode=5m3njzh3\u0026type=copy)，或者 macOS 或者能安装docker的win\n- 至少 3GB 内存，10G 可用存储空间 （如不使用 docker 容器提供 es、redis、mysql 全部或部分服务，可适当减少。单个es节点占用约1GB内存，默认启动了两个）\n- docker  \n```\ncurl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun\n```\n- docker-compose [安装教程](https://docs.docker.com/compose/install/)\n\n- 阿里云开通oss服务 [开通地址](https://www.aliyun.com/product/oss?spm=5176.12825654.eofdhaal5.87.ba052c4a8HQU3D\u0026aly_as=ge-cEkgv\u0026userCode=5m3njzh3)\n\n- 邮件服务 开通smtp服务 [开通教程](https://jingyan.baidu.com/article/6079ad0eb14aaa28fe86db5a.html)\n\n### 获取代码\n\n[项目地址](https://github.com/ymm-tech/gods-pen-docker)，该项目提供了 docker-compose 配置。\n\n```bash\ngit clone https://github.com/ymm-tech/gods-pen-docker.git\n```\n或直接下载并解压备用。\n\n### 配置\n\n项目提供了两个配置文件 config.yaml 和 nginx.conf。\n\nconfig.yaml 集中了码良所有依赖服务的配置，如 redis、mysql 等。其中 redis、mysql、es 服务由相应 docker 容器提供，保持默认配置即可（也可自行配置相关字段，并在 docker-compose.yaml 修改或移除对应服务）；[邮件](https://jingyan.baidu.com/article/6079ad0eb14aaa28fe86db5a.html)、[对象存储](https://www.aliyun.com/product/oss?spm=5176.12825654.eofdhaal5.87.ba052c4a8HQU3D\u0026aly_as=ge-cEkgv\u0026userCode=5m3njzh3)不由 docker 容器提供，必须自行填写对应配置（可自建或使用第三方服务）。\n\nnginx.conf 是nginx的配置文件，整合了码良内部的多个服务，是最终交付服务的实际入口。默认包含了最简配置，静态文件服务（含 html5 history 模式的支持，缓存）和api服务的反向代理，如需进行域名绑定等操作，可自行修改该文件进行配置。\n\n### 构建本地镜像\n\n完成配置以后，需要构建本地镜像。在项目根目录下运行 `make build` 或 `docker-compose build` 即可，构建过程耗时约4分钟，请耐心等待。\n\n首次构建后，除非 config.yaml 再次改变，否则无需再次构建。\n\n\n### 启动服务\n\n完成本地镜像构建以后就可以启动服务了。在项目根目录下运行 `make start-server` 或 `docker-compose up -d` ，服务被依次启动。\n\n启动服务的过程耗时约3分钟，可用 `docker logs \u003ccontainer id\u003e` 查看运行情况。\n\n启动成功后，访问地址为`http://\u003chost:port\u003e/admin`，如使用了 nginx.conf 默认配置，访问地址即 http://127.0.0.1/admin\n\n### 中止服务\n\n`make stop-server` 。暂停服务，不会删除现有容器，可通过 `make start-server` 再次恢复运行。\n\n### 终止服务\n\n`make remove-server` 。移除服务，会删除现有容器，可通过 `make start-server` 重新创建容器启动服务。\n\n## troubleshooting\n\n### es服务停止\n\n运行 `docker ps -a` 检查容器运行状态，发现所有 es 容器处于退出状态（exited），挨个查看 es 容器的日志, `docker logs es`，发现如下log\n\n\u003cpre style='color: #999;'\u003e\n[1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]\n[2019-04-30T02:43:52,717][INFO ][o.e.n.Node               ] [gKecOlD] stopping ...\n[2019-04-30T02:43:52,971][INFO ][o.e.n.Node               ] [gKecOlD] stopped\n[2019-04-30T02:43:52,971][INFO ][o.e.n.Node               ] [gKecOlD] closing ...\n[2019-04-30T02:43:53,041][INFO ][o.e.n.Node               ] [gKecOlD] closed\n\u003c/pre\u003e\n\n据 es 文档\n\n\u003e \u003csmall\u003eElasticsearch 对各种文件混合使用了 NioFs（ 注：非阻塞文件系统）和 MMapFs （ 注：内存映射文件系统）。请确保你配置的最大映射数量，以便有足够的虚拟内存可用于 mmapped 文件。这可以暂时设置：   \n`sysctl -w vm.max_map_count=262144`   \n或者你可以在 `/etc/sysctl.conf` 通过修改 `vm.max_map_count` 永久设置它\u003c/small\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fymm-tech%2Fgods-pen-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fymm-tech%2Fgods-pen-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fymm-tech%2Fgods-pen-docker/lists"}