Coder Social home page Coder Social logo

gods-pen-docker's Introduction

godspen On-Premise

WHAT

本项目提供了 码良 的私有部署(On-Premise)。基于 docker 及 docker-compose,部署你自己的 码良 服务。

码良 依赖 es、redis、mysql、邮件、oss服务,其中 es、redis、mysql 默认由docker容器提供,见 docker-compose.yaml。

视频教程

点击前往

HOW

必要条件

  • linux 系统或其他 linux 发行版 推荐阿里云上购买服务器,或者 macOS 或者能安装docker的win
  • 至少 3GB 内存,10G 可用存储空间 (如不使用 docker 容器提供 es、redis、mysql 全部或部分服务,可适当减少。单个es节点占用约1GB内存,默认启动了两个)
  • docker
curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun

获取代码

项目地址,该项目提供了 docker-compose 配置。

git clone https://github.com/ymm-tech/gods-pen-docker.git

或直接下载并解压备用。

配置

项目提供了两个配置文件 config.yaml 和 nginx.conf。

config.yaml 集中了码良所有依赖服务的配置,如 redis、mysql 等。其中 redis、mysql、es 服务由相应 docker 容器提供,保持默认配置即可(也可自行配置相关字段,并在 docker-compose.yaml 修改或移除对应服务);邮件对象存储不由 docker 容器提供,必须自行填写对应配置(可自建或使用第三方服务)。

nginx.conf 是nginx的配置文件,整合了码良内部的多个服务,是最终交付服务的实际入口。默认包含了最简配置,静态文件服务(含 html5 history 模式的支持,缓存)和api服务的反向代理,如需进行域名绑定等操作,可自行修改该文件进行配置。

构建本地镜像

完成配置以后,需要构建本地镜像。在项目根目录下运行 make builddocker-compose build 即可,构建过程耗时约4分钟,请耐心等待。

首次构建后,除非 config.yaml 再次改变,否则无需再次构建。

启动服务

完成本地镜像构建以后就可以启动服务了。在项目根目录下运行 make start-serverdocker-compose up -d ,服务被依次启动。

启动服务的过程耗时约3分钟,可用 docker logs <container id> 查看运行情况。

启动成功后,访问地址为http://<host:port>/admin,如使用了 nginx.conf 默认配置,访问地址即 http://127.0.0.1/admin

中止服务

make stop-server 。暂停服务,不会删除现有容器,可通过 make start-server 再次恢复运行。

终止服务

make remove-server 。移除服务,会删除现有容器,可通过 make start-server 重新创建容器启动服务。

troubleshooting

es服务停止

运行 docker ps -a 检查容器运行状态,发现所有 es 容器处于退出状态(exited),挨个查看 es 容器的日志, docker logs es,发现如下log

[1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
[2019-04-30T02:43:52,717][INFO ][o.e.n.Node               ] [gKecOlD] stopping ...
[2019-04-30T02:43:52,971][INFO ][o.e.n.Node               ] [gKecOlD] stopped
[2019-04-30T02:43:52,971][INFO ][o.e.n.Node               ] [gKecOlD] closing ...
[2019-04-30T02:43:53,041][INFO ][o.e.n.Node               ] [gKecOlD] closed

据 es 文档

Elasticsearch 对各种文件混合使用了 NioFs( 注:非阻塞文件系统)和 MMapFs ( 注:内存映射文件系统)。请确保你配置的最大映射数量,以便有足够的虚拟内存可用于 mmapped 文件。这可以暂时设置:
sysctl -w vm.max_map_count=262144
或者你可以在 /etc/sysctl.conf 通过修改 vm.max_map_count 永久设置它

gods-pen-docker's People

Contributors

arnan-wei avatar jy03078959 avatar mingyuanwei avatar panaru0430 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

gods-pen-docker's Issues

页面样式出现问题,该如何修改?

页面样式出现问题,该如何修改?因为对于提供的 docker 没有办法修改对应的样式。能否提供更加全面的 docker 源码包括项目原始代码?

windows docker desktop环境,启动报错

Starting gods-pen-docker_nginx_1 ... error

ERROR: for gods-pen-docker_nginx_1  Cannot start service nginx: OCI runtime create failed: container_linux.go:349: starting container process caused "process_linux.go:449: container init caused \"rootfs_l
inux.go:58: mounting \\\"/nginx.conf\\\" to rootfs \\\"/var/lib/docker/overlay2/ccc11f51efdb345fa49076ea06d93302ffb29e1bc45c9ce214ff83e1adbe81e8/merged\\\" at \\\"/var/lib/docker/overlay2/ccc11f51efdb345f
a49076ea06d93302ffb29e1bc45c9ce214ff83e1adbe81e8/merged/etc/nginx/conf.d/default.conf\\\" caused \\\"not a directory\\\"\"": unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check
 if the specified host path exists and is the expected type

为啥会有 aliyun 的请求呢?

在保存的时候出现请求,status 为 failed。

https://%3Cpre-domain%3E.aliyuncs.com/

还会有一个图片的失败请求

https://www.kuaizhan.com/common/encode-png?large=true&data=

mysql 容器自动退出,log 提示 sql 语法错误

执行 make start-server 后服务无法访问,mysql 容器自动退出,log 提示 sql 语法错误。如下内容:

/usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/A-init-table.sql
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1064 (42000) at line 183: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '`fork` INT(1) NULL DEFAULT '1' COMMENT '页面fork数量',
  PRIMARY KEY (`id`) ' at line 16

最终生成的静态页面存放在哪里?

你好,有两个问题请教下。

想了解最终生成的静态页面是存放在哪里的?能够提供下么?

还有oss上生成的是一个快照么? 那是不是没有oss页面没问题?

aliyun的oss并不能使用

已测试AK有权限,并且可通过aliyun的oss-browser进行各种权限操作,但是配置到config里面并不生效,邮件模块倒是正常

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.