一、Mininote介绍
1.Mininote简介
Mininote是一个简单、自托管、加密的 Markdown 笔记应用程序,使用Vue 3和Express构建。
2.Mininote使用场景
个人笔记:Mininote 提供了一个简单的界面,让你可以方便地撰写个人笔记。你可以使用 Markdown 语法来格式化文本,并且可以随时保存和编辑你的笔记。
日记记录:Mininote 可以作为一个日记应用程序,你可以在每天记录下自己的心情、想法和日常活动。每条日记都可以保存为一个 Markdown 文档,方便你长期保存和查看。
项目管理:如果你正在进行一个项目,Mininote 可以帮助你记录项目的进展、任务列表和备忘录。你可以创建多个笔记来组织不同的项目,并使用标签或文件夹来分类和归档。
学习笔记:无论是学习新知识还是复习旧知识,Mininote 都是一个很好的工具。你可以创建不同的笔记本来整理和记录你的学习内容,而且 Markdown 语法可以帮助你更好地组织和呈现笔记。
团队协作:如果你有一个小团队或者合作伙伴,Mininote 可以作为一个简单的协作工具。你可以创建一个共享笔记本,让团队成员可以编辑和评论笔记。而且你的笔记可以加密存储,保护你的隐私。
二、本次实践介绍
1. 本次实践简介
a.本次实践部署环境为个人腾讯云的测试环境,若是生产环境请谨慎部署;
b.本次实践为快速使用docker部署Mininote于个人腾讯云上。
2. 本地环境规划
本次实践环境规划:下载镜像Mininote,通过docker-cli或者docker compose启动容器
镜像命名 | IP地址 | 容器镜像版本 | 操作系统版本 |
Mininote | 43.138.153.157 | latest | centos7 |
三、检查本地Docker环境
1. 检查本地Docker版本
检查Docker版本:docker version
[root@VM-8-12-centos docker-compose]# docker version
Client: Docker Engine - Community
Version: 26.0.1
API version: 1.45
Go version: go1.21.9
Git commit: d260a54
Built: Thu Apr 11 10:56:30 2024
OS/Arch: linux/amd64
Context: default
Server: Docker Engine - Community
Engine:
Version: 26.0.1
API version: 1.45 (minimum version 1.24)
Go version: go1.21.9
Git commit: 60b9add
Built: Thu Apr 11 10:55:26 2024
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.6.31
GitCommit: e377cd56a71523140ca6ae87e30244719194a521
runc:
Version: 1.1.12
GitCommit: v1.1.12-0-g51d5e94
docker-init:
Version: 0.19.0
GitCommit: de40ad0
2. 检查Docker服务状态
检查Docker服务状态,确保Docker服务正常运行。
docker version
[root@VM-8-12-centos docker-compose]# docker version
Client: Docker Engine - Community
Version: 26.0.1
API version: 1.45
Go version: go1.21.9
Git commit: d260a54
Built: Thu Apr 11 10:56:30 2024
OS/Arch: linux/amd64
Context: default
Server: Docker Engine - Community
Engine:
Version: 26.0.1
API version: 1.45 (minimum version 1.24)
Go version: go1.21.9
Git commit: 60b9add
Built: Thu Apr 11 10:55:26 2024
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.6.31
GitCommit: e377cd56a71523140ca6ae87e30244719194a521
runc:
Version: 1.1.12
GitCommit: v1.1.12-0-g51d5e94
docker-init:
Version: 0.19.0
GitCommit: de40ad0
[root@VM-8-12-centos docker-compose]# 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 Tue 2024-04-16 12:52:35 CST; 6 days ago
Docs: https://docs.docker.com
Main PID: 1423 (dockerd)
Tasks: 96
Memory: 325.0M
CGroup: /system.slice/docker.service
├─ 1423 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
├─ 1919 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 6379 -container-ip 172.20.0.3 -container-port 6379
├─ 1925 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 6379 -container-ip 172.20.0.3 -container-port 6379
├─ 1939 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 3307 -container-ip 172.20.0.4 -container-port 3306
├─ 1945 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 3307 -container-ip 172.20.0.4 -container-port 3306
├─ 3105 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 8080 -container-ip 172.20.0.6 -container-port 3000
├─ 3111 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 8080 -container-ip 172.20.0.6 -container-port 3000
├─ 7776 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 6389 -container-ip 172.20.0.5 -container-port 3000
├─ 7781 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 6389 -container-ip 172.20.0.5 -container-port 3000
├─12090 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 1288 -container-ip 172.20.0.7 -container-port 8080
├─12095 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 1288 -container-ip 172.20.0.7 -container-port 8080
├─23800 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 80 -container-ip 172.20.0.2 -container-port 80
└─23806 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 80 -container-ip 172.20.0.2 -container-port 80
Apr 21 17:22:45 VM-8-12-centos dockerd[1423]: time="2024-04-21T17:22:45.025665322+08:00" level=error msg="[resolver] failed to query external DNS serve...Apr 21 17:22:49 VM-8-12-centos dockerd[1423]: time="2024-04-21T17:22:49.026714634+08:00" level=error msg="[resolver] failed to query external DNS serve...Apr 21 17:22:50 VM-8-12-centos dockerd[1423]: time="2024-04-21T17:22:50.276218127+08:00" level=error msg="[resolver] failed to query external DNS serve...Apr 21 17:22:54 VM-8-12-centos dockerd[1423]: time="2024-04-21T17:22:54.277221448+08:00" level=error msg="[resolver] failed to query external DNS serve...Apr 21 17:24:48 VM-8-12-centos dockerd[1423]: time="2024-04-21T17:24:48.494298386+08:00" level=info msg="ignoring event" container=d88bf968f647...kDelete"Apr 21 22:25:07 VM-8-12-centos dockerd[1423]: time="2024-04-21T22:25:07.888659304+08:00" level=info msg="ignoring event" container=d88bf968f647...kDelete"Apr 22 19:34:46 VM-8-12-centos dockerd[1423]: time="2024-04-22T19:34:46.261208371+08:00" level=info msg="ignoring event" container=2995fd2067c2...kDelete"Apr 22 19:34:46 VM-8-12-centos dockerd[1423]: time="2024-04-22T19:34:46.289007775+08:00" level=warning msg="ShouldRestart failed, container will not be...Apr 22 19:36:18 VM-8-12-centos dockerd[1423]: 2024/04/22 19:36:18 http: superfluous response.WriteHeader call from go.opentelemetry.io/contrib/...p.go:98)Apr 22 20:04:27 VM-8-12-centos dockerd[1423]: 2024/04/22 20:04:27 http: superfluous response.WriteHeader call from go.opentelemetry.io/contrib/...p.go:98)
四、部署Mininote镜像
1.下载Mininote
[root@VM-8-12-centos docker-compose]# docker pull getpinry/pinry
Using default tag: latest
latest: Pulling from getpinry/pinry
4be315f6562f: Pull complete
e48a5ab1f21f: Pull complete
730ced303824: Pull complete
1c3b463a512e: Pull complete
95e23bd9dfcb: Pull complete
c728b3f275bf: Pull complete
c5667646c02b: Pull complete
07a506085222: Pull complete
1e4c3cf32f67: Pull complete
3c9ff41cf479: Pull complete
07b54ca8e520: Pull complete
c498c133f0a9: Pull complete
75ea46ebcf6b: Pull complete
2ac2584e10b6: Pull complete
2f1caeb29d1d: Pull complete
d38c8c261638: Pull complete
Digest: sha256:b0f9eeb195d478d9a989e220861b4638f4fb489d02fdaac1e46bbacd46e90a96
Status: Downloaded newer image for getpinry/pinry:latest
docker.io/getpinry/pinry:latest
2.创建Mininote目录
mkdir -p /opt/mininote
3.生成ssl证书
openssl genrsa -out mininote.key 2048
openssl req -new -key mininote.key -out mininote.csr
openssl x509 -req -in mininote.csr -signkey mininote.key -out mininote.crt
4.docker-compose启动文件
version: '3.9'
services:
mininote:
image: 'ghcr.io/muety/mininote:latest'
environment:
- HTTPS_KEY=/etc/mininote.key
- HTTPS_CERT=/etc/mininote.crt
volumes:
- '/opt/mininote/mininote.key:/etc/mininote.key:ro'
- '/opt/mininote/mininote.crt:/etc/mininote.crt:ro'
- '/opt/mininote:/app/data'
container_name: mininote
ports:
- '3120:3000'
5.docker-cli启动
docker run -d -p 3120:3000 --name mininote -v /opt/mininote:/app/data -v /opt/mininote/mininote.crt:/etc/mininote.crt:ro -v /opt/mininote/mininote.key:/etc/mininote.key:ro -e HTTPS_CERT=/etc/mininote.crt -e HTTPS_KEY=/etc/mininote.key ghcr.io/muety/mininote:latest
6.启动docker-compose
docker compose up -d
7.查Mininote容器状态
docker ps |grep Mininote
[root@VM-8-12-centos docker-compose]# docker ps |grep pinry
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
85bdd20a8bf8 ghcr.io/muety/mininote:latest "/bin/sh -c 'yarn st…" 5 seconds ago Up 4 seconds 0.0.0.0:3120->3000/tcp, :::3120->3000/tcp mininote
8.查Mininote日志状态
docker logs -f Mininote
[root@VM-8-12-centos docker-compose]# docker logs -f mininote
yarn run v1.22.19
$ node index.js
Listening on localhost:3000.
六、访问Mininote首页
注:云服务器记得放开防火墙!
访问地址https://43.138.153.157:3120/,欢迎点击玩一下!
ps:内网穿透搭建好了,minipc可以撑一段时间,这些测试的服务应该会保留一段时间...如果有需要体验的但是服务已经被我down了的,可以在微信公众号《零氪的云原生》私我开启!