一、zyplayer-doc介绍
1.zyplayer-doc是一款适合企业和个人使用的WIKI知识库管理工具,提供在线化的知识库管理功能,专为私有化部署而设计,最大程度上保证企业或个人的数据安全,公司小团队的话完全可以局域网部署一个。
2.它也可以将其作为企业产品的说明文档来使用,支持一键将整个空间的内容开放到互联网,并提供有不同风格的开放文档页样式可供选择,省去为了产品的说明文档而去定制开发一个系统的成本。
3.管理控制台做到了用户的统一登录控制、文档导航、以及用户管理,其中统一登录支持三方的SSO登录系统接入,用户管理可对系统所有用户进行增删改查操作。
4.知识库支持按空间隔离,每个空间内文档相互独立,互不影响,每个空间可单独设置LOGO和封面,设置空间开放状态及空间成员权限,知识库页面可对所有的文档标题及内容进行搜索,空间可无限创建,无数量限制。空间内可创建页面,支持HTML富文本编辑器和Markdown编辑
二、本次实践介绍
本次实践简介
本次实践部署环境为个人测试环境
本地环境规划
本次实践环境规划:下载镜像fastposter/fastposter:latest,通过docker-cli或者docker compose启动容器
镜像命名 | IP地址 | 容器镜像版本 | 操作系统版本 |
---|---|---|---|
zyplayer-doc | 192.168.2.76 | latest | ubuntu 22.04 |
三、检查本地Docker环境
检查本地Docker版本
检查Docker版本:docker version
root@WellDone:/home/goodjob# docker version
Client: Docker Engine - Community
Version: 25.0.0
API version: 1.44
Go version: go1.21.6
Git commit: e758fe5
Built: Thu Jan 18 17:09:49 2024
OS/Arch: linux/amd64
Context: default
Server: Docker Engine - Community
Engine:
Version: 25.0.0
API version: 1.44 (minimum version 1.24)
Go version: go1.21.6
Git commit: 615dfdf
Built: Thu Jan 18 17:09:49 2024
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.6.27
GitCommit: a1496014c916f9e62104b33d1bb5bd03b0858e59
runc:
Version: 1.1.11
GitCommit: v1.1.11-0-g4bccb38
docker-init:
Version: 0.19.0
GitCommit: de40ad0
root@WellDone:/home/goodjob#
检查Docker服务状态
检查Docker服务状态,确保Docker服务正常运行。
systemctl status docker
root@WellDone:/home/goodjob/Downloads# systemctl status docker
● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2024-01-24 08:54:31 CST; 1 day 4h ago
TriggeredBy: ● docker.socket
Docs: https://docs.docker.com
Main PID: 1549 (dockerd)
Tasks: 65
Memory: 419.5M
CPU: 38.874s
CGroup: /system.slice/docker.service
├─ 1549 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
├─ 2010 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 6379 -container-ip 172.17.0.2 -container-port 6379
├─ 2016 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 6379 -container-ip 172.17.0.2 -container-port 6379
├─ 2029 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 5432 -container-ip 172.17.0.3 -container-port 5432
├─ 2036 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 5432 -container-ip 172.17.0.3 -container-port 5432
├─123083 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 8888 -container-ip 172.17.0.4 -container-port 8080
└─123095 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 8888 -container-ip 172.17.0.4 -container-port 8080
1月 24 08:54:31 WellDone dockerd[1549]: time="2024-01-24T08:54:31.067895045+08:00" level=info msg="API listen on /run/docker.sock"
1月 24 08:54:31 WellDone systemd[1]: Started Docker Application Container Engine.
1月 24 16:13:48 WellDone dockerd[1549]: time="2024-01-24T16:13:48.185008219+08:00" level=info msg="ignoring event" container=8ad99af82d8a41dd661d>
1月 24 16:13:48 WellDone dockerd[1549]: time="2024-01-24T16:13:48.189484205+08:00" level=warning msg="ShouldRestart failed, container will not be>
1月 24 21:58:08 WellDone dockerd[1549]: time="2024-01-24T21:58:08.024915139+08:00" level=info msg="ignoring event" container=27fd28e2993f31b170b8>
1月 24 21:58:08 WellDone dockerd[1549]: time="2024-01-24T21:58:08.029986730+08:00" level=warning msg="ShouldRestart failed, container will not be>
1月 25 10:46:16 WellDone dockerd[1549]: time="2024-01-25T10:46:16.329180722+08:00" level=info msg="Container failed to exit within 10s of signal >
1月 25 10:46:16 WellDone dockerd[1549]: time="2024-01-25T10:46:16.350757439+08:00" level=info msg="ignoring event" container=b1223add00f36bbb3246>
1月 25 10:49:21 WellDone dockerd[1549]: time="2024-01-25T10:49:21.993755983+08:00" level=info msg="Container failed to exit within 10s of signal >
1月 25 10:49:22 WellDone dockerd[1549]: time="2024-01-25T10:49:22.015822650+08:00" level=info msg="ignoring event" container=edb0e153b45dbe62acd8>
lines 1-28/28 (END)
四、部署zyplayer-doc镜像
下载zyplayer-doc镜像
docker pull zyplayer/zyplayer-doc:latest
root@HEJIAJIN-FX506HE:/docker_software# docker pull zyplayer/zyplayer-doc:latest
Using default tag: latest
latest: Pulling from zyplayer/zyplayer-doc
7d63c13d9b9b: Pull complete
6ad2a11ca37b: Pull complete
8076cdef4689: Pull complete
0ba90f5a7dd0: Pull complete
27c191df269f: Pull complete
e332e26a6509: Pull complete
b6aa2cfacc25: Pull complete
Digest: sha256:0d1c173c7bc5ef6b51a815a995f06dd89b4902e4773be98687259134cf6ea267
Status: Downloaded newer image for zyplayer/zyplayer-doc:latest
docker.io/zyplayer/zyplayer-doc:latest
创建容器
使用docker快速创建zyplayer-doc的容器。
完整创建过程:
1.先需要有对应对应的mysql,库名是zyplayer_doc
如果还没有mysql的,可以快速创建一个,如下:
A.docker pull mysql:latest
B.mkdir -p /docker-compose/mysql/conf /opt/module/mysql/data
C.vim /docker-compose/mysql/conf/my.cnf
编辑的时候输入如下:
[client]
default-character-set = utf8
[mysqld]
bind-address=0.0.0.0
datadir = /docker-compose/mysql/data
character_set_server = utf8
collation_server = utf8_bin
secure-file-priv= NULL
symbolic-links=0
!includedir /etc/mysql/conf.d/
D.保存,启动mysql
docker run --restart=unless-stopped -d --name mysql -v /docker-compose/mysql/conf/my.cnf:/etc/mysql/my.cnf -v /docker-compose/mysql/data:/var/lib/mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=123456 mysql:latest
注:以上挂载的路径需要自己设定,如/docker-compose/mysql/conf
E.docker exec -it mysql /bin/bash
F.mysql -uroot -p
123456
G.create database zyplayer_doc;
2.使用docker-cli启动一个zyplayer-doc的容器。
docker run -d -p 8989:8083 --name zyplayer-doc -e DATASOURCE_HOST_PORT=192.168.2.76:3306 -e DATASOURCE_USER=root -e DATASOURCE_PASSWORD=123456 zyplayer/zyplayer-doc:latest
3.使用docker-compose启动一个zyplayer-doc的容器
version: '3.9'
services:
mysql:
image: 'mysql:latest'
environment:
- MYSQL_ROOT_PASSWORD=123456
ports:
- '3306:3306'
volumes:
- '/docker-compose/mysql/data:/var/lib/mysql'
- '/docker-compose/mysql/conf/my.cnf:/etc/mysql/my.cnf'
container_name: mysql
restart: unless-stopped
zyplayer-doc:
image: 'zyplayer/zyplayer-doc:latest'
environment:
- DATASOURCE_PASSWORD=123456
- DATASOURCE_USER=root
- 'DATASOURCE_HOST_PORT=192.168.2.76:3306'
container_name: zyplayer-doc
depends_on:
- mysql
ports:
- '8989:8083'
检查容器运行状态
检查容器的运行状态,确保服务的正常运行。
docker ps
NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS
3470b66ac5ee zyplayer/zyplayer-doc:latest "java -Djava.securit…" 3 seconds ago Up 2 seconds 0.0.0.0:8989->8083/tcp, :::8989->8083/tcp zyplayer-doc
查看容器运行日志
docker logs -f zyplayer-doc
root@HEJIAJIN-FX506HE:/docker-compose/mysql/conf# docker logs -f zyplayer-doc
[2024-03-17 15:36:50][INFO ][Application] Starting Application using Java 11.0.16 on 3470b66ac5ee with PID 1 (/zyplayer-doc.jar started by root in /)
[2024-03-17 15:36:50][INFO ][Application] No active profile set, falling back to 1 default profile: "default"
[2024-03-17 15:36:50][INFO ][RepositoryConfigurationDelegate] Bootstrapping Spring Data LDAP repositories in DEFAULT mode.
[2024-03-17 15:36:50][INFO ][RepositoryConfigurationDelegate] Finished Spring Data repository scanning in 10 ms. Found 0 LDAP repository interfaces.
[2024-03-17 15:36:50][INFO ][a] 缓存策略:内存缓存
[2024-03-17 15:36:51][INFO ][TomcatWebServer] Tomcat initialized with port(s): 8083 (http)
[2024-03-17 15:36:51][INFO ][Http11NioProtocol] Initializing ProtocolHandler ["http-nio-8083"]
[2024-03-17 15:36:51][INFO ][StandardService] Starting service [Tomcat]
[2024-03-17 15:36:51][INFO ][StandardEngine] Starting Servlet engine: [Apache Tomcat/9.0.82]
[2024-03-17 15:36:51][INFO ][[/]] Initializing Spring embedded WebApplicationContext
[2024-03-17 15:36:51][INFO ][ServletWebServerApplicationContext] Root WebApplicationContext: initialization completed in 1043 ms
[2024-03-17 15:36:51][INFO ][DruidDataSource] {dataSource-1,zyplayer-doc-1} inited
[2024-03-17 15:36:52][INFO ][a] 开始检查当前数据库DDL版本
[2024-03-17 15:36:52][INFO ][a] 当前数据库DDL已是最新版本:2.3.3
[2024-03-17 15:36:53][INFO ][WelcomePageHandlerMapping] Adding welcome page: class path resource [META-INF/resources/index.html]
[2024-03-17 15:36:53][INFO ][Http11NioProtocol] Starting ProtocolHandler ["http-nio-8083"]
[2024-03-17 15:36:53][INFO ][TomcatWebServer] Tomcat started on port(s): 8083 (http) with context path ''
[2024-03-17 15:36:53][INFO ][Application] Started Application in 3.492 seconds (JVM running for 3.903)
[2024-03-17 15:36:53][INFO ][Application]
-------------------------------------------------------------
zyplayer-doc Launch completed, Current version: 2.3.3
Access address: http://172.17.0.3:8083/
-------------------------------------------------------------
五、访问zyplayer-doc
访问地址:http://localhost:898 账号zyplayer 密码123456
任意使用!