【打工日常】云原生之使用Docker部署开源云笔记工具Leanote

本文主要是介绍【打工日常】云原生之使用Docker部署开源云笔记工具Leanote,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

一、Leanote蚂蚁笔记介绍

1.Leanote简介

Leanote 蚂蚁笔记是一款国产开源的私有云笔记工具。它支持普通格式笔记、Markdown语法、专业数学公式编辑、和思维导图,并且支持vim&emacs等编辑模式。

2.Leanote功能

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

二、本次实践介绍

1. 本次实践简介

a.本次实践部署环境为个人笔记本ubuntu日常工作的测试环境,若是生产环境请谨慎部署;

b.本次实践为快速使用docker部署开源Leanote蚂蚁笔记于个人ubuntu上,若是需要部署在个人的服务环境也可以作为参考;正式的环境需要控制好网络策略,以及使用dockerfile去创建独立的环境,做好挂载文件的定时备份和docker日志清理,使用轻量级或者某个节点去监控对应的应用和资源。

2. 本地环境规划

本次实践环境规划:下载镜像leanote/leanote:latest,通过docker-cli或者docker compose启动容器

镜像命名IP地址容器镜像版本操作系统版本
leanotelocalhostlatestubuntu 22.04

三、检查本地Docker环境

1. 检查本地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#

2. 检查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)

四、下载Leanote镜像

1.下载Leanote镜像root@HEJIAJIN-FX506HE:/home/welldone# 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:latest2.创建数据目录
创建Leanote容器挂载的数据目录root@HEJIAJIN-FX506HE:/docker-compose# mkdir -p /docker-compose/leanote/{db,conf,files,upload}root@HEJIAJIN-FX506HE:/docker-compose# tree leanote/
leanote/
├── conf
├── db
├── files
└── upload4 directories, 0 files3.创建Leanote容器
使用docker-cli命令快速创建Leanote容器。docker run -d -p 9898:9000 \-e "TZ=Asia/Shanghai"\--restart=always-v /docker-compose/leanote/db:/data/db \-v /docker-compose/leanote/conf/:/data/leanote/conf \-v /docker-compose/leanote/files:/data/leanote/files \-v /docker-compose/leanote/upload:/data/leanote/public/upload \--name leanote \axboy/leanote4.使用docker-compose启动一个zyplayer-doc的容器  version: '3.9'
services:leanote:image: axboy/leanotecontainer_name: leanotevolumes:- '/docker-compose/leanote/upload:/data/leanote/public/upload'- '/docker-compose/leanote/files:/data/leanote/files'- '/docker-compose/leanote/conf/:/data/leanote/conf'- '/docker-compose/leanote/db:/data/db'restart: alwaysenvironment:- TZ=Asia/Shanghaiports:- '9898:9000'5.查看Leanote容器状态root@HEJIAJIN-FX506HE:/docker-compose/docker-compose/docker-test# docker ps
CONTAINER ID   IMAGE                                                              COMMAND                   CREATED              STATUS                    PORTS                                                      NAMES
a8ac4caf9d3b   axboy/leanote                                                      "docker-entrypoint.s…"   About a minute ago   Up About a minute         27017/tcp, 0.0.0.0:9898->9000/tcp, :::9898->9000/tcp       leanote6.查看Leanote占用资源检查Leanote容器所在系统资源。root@HEJIAJIN-FX506HE:/docker-compose/docker-compose/docker-test# docker stats --no-stream leanote
CONTAINER ID   NAME      CPU %     MEM USAGE / LIMIT     MEM %     NET I/O          BLOCK I/O     PIDS
a8ac4caf9d3b   leanote   0.17%     95.86MiB / 15.35GiB   0.61%     87.8kB / 853kB   0B / 73.9MB   57

六、访问Leanote首页

访问地址http://localhost:9898/
1.首页:

2.选择语言为简体中文

3.登录Leanote
管理员账号admin, 密码abc123

4.新建笔记

5. 后台管理

6. 设置笔记为公开博客

7. 查看个人博客页面

这篇关于【打工日常】云原生之使用Docker部署开源云笔记工具Leanote的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/932104

相关文章

Python基于wxPython和FFmpeg开发一个视频标签工具

《Python基于wxPython和FFmpeg开发一个视频标签工具》在当今数字媒体时代,视频内容的管理和标记变得越来越重要,无论是研究人员需要对实验视频进行时间点标记,还是个人用户希望对家庭视频进行... 目录引言1. 应用概述2. 技术栈分析2.1 核心库和模块2.2 wxpython作为GUI选择的优

使用Sentinel自定义返回和实现区分来源方式

《使用Sentinel自定义返回和实现区分来源方式》:本文主要介绍使用Sentinel自定义返回和实现区分来源方式,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录Sentinel自定义返回和实现区分来源1. 自定义错误返回2. 实现区分来源总结Sentinel自定

Pandas使用SQLite3实战

《Pandas使用SQLite3实战》本文主要介绍了Pandas使用SQLite3实战,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学... 目录1 环境准备2 从 SQLite3VlfrWQzgt 读取数据到 DataFrame基础用法:读

JSON Web Token在登陆中的使用过程

《JSONWebToken在登陆中的使用过程》:本文主要介绍JSONWebToken在登陆中的使用过程,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录JWT 介绍微服务架构中的 JWT 使用结合微服务网关的 JWT 验证1. 用户登录,生成 JWT2. 自定义过滤

Java中StopWatch的使用示例详解

《Java中StopWatch的使用示例详解》stopWatch是org.springframework.util包下的一个工具类,使用它可直观的输出代码执行耗时,以及执行时间百分比,这篇文章主要介绍... 目录stopWatch 是org.springframework.util 包下的一个工具类,使用它

Java使用Curator进行ZooKeeper操作的详细教程

《Java使用Curator进行ZooKeeper操作的详细教程》ApacheCurator是一个基于ZooKeeper的Java客户端库,它极大地简化了使用ZooKeeper的开发工作,在分布式系统... 目录1、简述2、核心功能2.1 CuratorFramework2.2 Recipes3、示例实践3

springboot security使用jwt认证方式

《springbootsecurity使用jwt认证方式》:本文主要介绍springbootsecurity使用jwt认证方式,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地... 目录前言代码示例依赖定义mapper定义用户信息的实体beansecurity相关的类提供登录接口测试提供一

go中空接口的具体使用

《go中空接口的具体使用》空接口是一种特殊的接口类型,它不包含任何方法,本文主要介绍了go中空接口的具体使用,具有一定的参考价值,感兴趣的可以了解一下... 目录接口-空接口1. 什么是空接口?2. 如何使用空接口?第一,第二,第三,3. 空接口几个要注意的坑坑1:坑2:坑3:接口-空接口1. 什么是空接

springboot security快速使用示例详解

《springbootsecurity快速使用示例详解》:本文主要介绍springbootsecurity快速使用示例,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝... 目录创www.chinasem.cn建spring boot项目生成脚手架配置依赖接口示例代码项目结构启用s

Python如何使用__slots__实现节省内存和性能优化

《Python如何使用__slots__实现节省内存和性能优化》你有想过,一个小小的__slots__能让你的Python类内存消耗直接减半吗,没错,今天咱们要聊的就是这个让人眼前一亮的技巧,感兴趣的... 目录背景:内存吃得满满的类__slots__:你的内存管理小助手举个大概的例子:看看效果如何?1.