云原生之使用Docker部署开源Leanote蚂蚁笔记

一、Leanote蚂蚁笔记介绍

1.Leanote简介

Leanote 蚂蚁笔记是一款云笔记工具,蚂蚁笔记(又名LeaNote)就是一款国产开源的私有云笔记软件。它支持普通格式笔记、Markdown语法、专业数学公式编辑、和思维脑图,常见的笔记相关功能它都拥有,同时也支持 vim&emacs 输入,持私有本地部署。

2.Leanote功能

  • Markdown 语法支持
  • 无干扰写作模式
  • Vim和Emacs编辑模式
  • 将笔记导出为 PDF
  • 批注操作
  • 可定制的博客主题
  • 思维导图功能
  • Docker快速本地化部署

二、本次实践介绍

1. 本次实践简介

1.本次实践部署环境为个人测试环境,生产环境请谨慎;
2.本次实践为快速使用docker部署开源Leanote蚂蚁笔记。

2. 本地环境规划

本次实践环境规划:

hostname IP地址 Leanote镜像版本 操作系统版本
jeven 192.168.3.166 latest centos 7.6

三、检查本地Docker环境

1. 检查本地Docker版本

检查Docker版本

[root@jeven ~]# docker version
Client: Docker Engine - Community
 Version:           20.10.17
 API version:       1.41
 Go version:        go1.17.11
 Git commit:        100c701
 Built:             Mon Jun  6 23:05:12 2022
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.17
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.17.11
  Git commit:       a89b842
  Built:            Mon Jun  6 23:03:33 2022
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.6
  GitCommit:        10c12954828e7c7c9b6e0ea9b0c02b01407d3ae1
 runc:
  Version:          1.1.2
  GitCommit:        v1.1.2-0-ga916309
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

2. 检查Docker服务状态

检查Docker服务状态,确保Docker服务正常运行。

[root@jeven ~]# systemctl status docker
● docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
   Active: active (running) since Mon 2023-05-15 20:34:37 CST; 9h ago
     Docs: https://docs.docker.com
 Main PID: 10133 (dockerd)
    Tasks: 25
   Memory: 1.1G

四、下载Leanote镜像

本次使用Leanote容器镜像从dockerhub拉取,版本为latest版本。

[root@node ~]# docker pull axboy/leanote
Using default tag: latest
latest: Pulling from axboy/leanote
23884877105a: Pull complete 
bc38caa0f5b9: Pull complete 
2910811b6c42: Pull complete 
36505266dcc6: Pull complete 
a4d269900d94: Pull complete 
5e2526abb80a: Pull complete 
d3eece1f39ec: Pull complete 
358ed78d3204: Pull complete 
1a878b8604ae: Pull complete 
978c572f0440: Pull complete 
35a600ffcf6a: Pull complete 
fa9f812cdfe6: Pull complete 
7a8109e27110: Pull complete 
e7cb12a43d53: Pull complete 
98477f6eb1fd: Pull complete 
Digest: sha256:9542a462043c9d293e8eda12e1b48ada77ae411121583631c5fa94083a730ef5
Status: Downloaded newer image for axboy/leanote:latest
docker.io/axboy/leanote:latest

五、部署Leanote应用

1.创建数据目录

创建Leanote容器挂载的数据目录

[root@node ~]# mkdir -p /data/leanote/{db,conf,files,upload}
[root@node ~]# cd /data/leanote/
[root@node leanote]# 

2.创建Leanote容器

使用docker-cli命令快速创建Leanote容器。

docker run -d -p 9800:9000 \
    -e "TZ=Asia/Shanghai"\
    --restart=always\
    -v /data/leanote/db:/data/db \
    -v /data/leanote/conf/:/data/leanote/conf \
    -v /data/leanote/files:/data/leanote/files \
    -v /dataleanote/upload:/data/leanote/public/upload \
    -m 50M --oom-kill-disable --memory-swap=-1\
    --name leanote \
    axboy/leanote

image.png

3.查看Leanote容器状态

检查Leanote容器状态状态

[root@node leanote]# docker ps
CONTAINER ID   IMAGE                                                   COMMAND                  CREATED          STATUS          PORTS                                                                                                                             NAMES
587ff7c0b1c7   axboy/leanote                                           "docker-entrypoint.s…"   18 seconds ago   Up 14 seconds   27017/tcp, 0.0.0.0:9800->9000/tcp, :::9800->9000/tcp                                                                              leanote

4.查看Leanote占用资源

检查Leanote容器所在系统资源。


[root@node leanote]# docker stats --no-stream leanote 
CONTAINER ID   NAME      CPU %     MEM USAGE / LIMIT   MEM %     NET I/O     BLOCK I/O       PIDS
587ff7c0b1c7   leanote   0.30%     31.5MiB / 50MiB     63.01%    656B / 0B   541MB / 904MB   43

六、访问Leanote首页

直接访问:http://192.168.3.166:9800/
进入Leanote首页

image.png

七、Leanote基本操作

1.设置简体中文

选择语言为简体中文

image.png

2.登录Leanote

user1 username: admin, password: abc123 (管理员, 只有该用户才有权管理后台, 请及时修改密码)
user2 username: [email protected], password: [email protected] (仅供体验使用)

image.png

image.png

3.新建笔记

image.png

4. 后台管理

进入Leanote蚂蚁笔记的后台管理

在这里插入图片描述

在这里插入图片描述

八、Leanote的博客功能

1. 设置笔记为公开博客

将个人笔记设置为公开博客

在这里插入图片描述

2. 查看个人博客页面

选择“我的博客”功能模块,进入个人博客页面。

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

3. 博客设置

选择博客设置,进入博客管理页面。

在这里插入图片描述
在这里插入图片描述

4. 更换博客主题

在博客管理页面,选择个人喜欢的主题。

在这里插入图片描述
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/jks212454/article/details/130686077