第2篇【Docker项目实战】使用Docker部署Raneto知识库平台(转载)

news2024/7/6 18:02:03

【Docker项目实战】使用Docker部署Raneto知识库平台

一、Raneto介绍

1.1 Raneto简介

Raneto是一个免费、开放、简单的 Markdown 支持的 Node.js 知识库。

1.2 知识库介绍

  • 知识库

知识库是指存储和组织知识的系统或库,它包括了各种类型的信息和知识,如文本、图像、音频、视频等。知识库可以用于存储和检索知识,帮助人们获取特定领域的知识和解决问题。知识库通常由专业人员创建和维护,他们通过收集和整理各种资源和信息来构建一个完整的知识库。知识库可以包含大量的知识和信息,涵盖多个领域和主题。知识库可以用于多种用途,例如教育、研究、咨询等。它可以为学生提供学习资料和参考文献,为研究人员提供相关领域的最新研究成果,为咨询师提供解决问题的指导。知识库的优势在于它能够集中存储和组织大量的知识和信息,使其易于访问和使用。此外,知识库还可以通过搜索和过滤功能来帮助用户快速找到所需的知识和信息。

  • 知识库工具

知识库工具是一种用于收集、组织、存储和检索知识的软件工具。它们提供了一个集中的平台,可以方便地创建、记录和共享知识,以便团队成员或用户可以随时访问和使用。

二、本地环境介绍

2.1 本地环境规划

本次实践为个人测试环境,操作系统版本为centos7.6。

hostnameIP地址操作系统版本Docker版本
dokcer192.168.3.166centos 7.62 20.10.17

2.2 本次实践介绍

1.本次实践部署环境为个人测试环境,生产环境请谨慎; 2.本次实践需要提前在自己服务器上配置好Docker环境,确保Docker环境正常; 3.在Docker环境下部署Raneto知识库平台。

三、本地环境检查

3.1 检查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 Fri 2023-12-01 22:00:49 CST; 3 days ago
     Docs: https://docs.docker.com
 Main PID: 11506 (dockerd)
    Tasks: 10
   Memory: 935.8M
   CGroup: /system.slice/docker.service
           └─11506 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock

3.2 检查Docker版本

检查Docker版本

[root@jeven ~]# docker -v
Docker version 20.10.17, build 100c701

3.3 检查docker compose 版本

检查Docker compose版本,确保2.0以上版本。

[root@jeven ~]# docker compose version
Docker Compose version v2.6.01.2.

四、下载Raneto镜像

从docker hub拉取Raneto镜像,版本为latest镜像。如果镜像拉取缓慢,则可以配置国内云厂商的容器镜像加速,提高下载速度。

[root@jeven ~]#  docker pull  raneto/raneto:latest
latest: Pulling from raneto/raneto
7264a8db6415: Pull complete
d68f2f1a5d31: Pull complete
e7e6b7606c1a: Pull complete
904e9a84b7a0: Pull complete
88e752eeee15: Pull complete
14e927c1dd9e: Pull complete
a3e1caebe52b: Pull complete
Digest: sha256:ed0d2d846ed6239791d67bbe0420c6fa2c7a8d2e2d5d30d17fb726e77c9dd576
Status: Downloaded newer image for raneto/raneto:latest
docker.io/raneto/raneto:latest

五、部署Raneto知识库平台

5.1 创建挂载目录

创建挂载目录/data/raneto/

mkdir -p /data/raneto/{config,content} && cd /data/raneto

设置目录权限

chmod -R 777 /data/raneto

5.2 编辑config.js文件

Raneto的配置文件为config.js,在我们新建 /data/raneto/config目录下,编辑config.js文件。

// Modules
var path = require('path');

// Which Theme to Use?
//
// Local Directory Example (for development or custom themes)
// var theme_dir = path.join(__dirname, 'themes');
// var theme_name = 'my-theme-directory';
//
// Themes from NPM
// use "dist" as the theme name for modules (for now)
var theme_dir = path.join(
  __dirname,
  '..',
  'node_modules',
  '@raneto/theme-default'
);
var theme_name = 'dist';

var config = {
  // Your site title (format: page_title - site_title)
  site_title: 'Raneto Docs',

  // The base URL of your site (can use %base_url% in Markdown files)
  // This should be the full path to your Raneto installation:
  //   example 1: https://raneto.mydomain.com
  //   example 2: https://www.mydomain.com/raneto
  // Do not include a trailing "/"
  // Leave this as an empty string to use the default
  base_url: '',
  nowrap: true,

  // Path Prefix
  // If you are running Raneto on a subpath of your domain, add it here
  // Leave it blank if you are not sure
  //
  // Example: if you are running Raneto at http://www.mydomain.com/raneto
  //          then you would enter '/raneto' below
  path_prefix: '',

  // Used for the "Get in touch" page footer link
  support_email: '',

  // Footer Text / Copyright
  copyright: `Copyright © ${new Date().getFullYear()} - <a href="https://raneto.com">Powered by Raneto</a>`,

  // Excerpt length (used in search)
  excerpt_length: 400,

  // The meta value by which to sort pages (value should be an integer)
  // If this option is blank pages will be sorted alphabetically
  page_sort_meta: 'sort',

  // Should categories be sorted numerically (true) or alphabetically (false)
  // If true category folders need to contain a "sort" file with an integer value
  category_sort: true,

  // Controls behavior of home page if meta ShowOnHome is not present. If set to true
  // all categories or files that do not specify ShowOnHome meta property will be shown
  show_on_home_default: true,

  // Theme (see top of file)
  theme_dir,
  theme_name,

  // Specify the path of your content folder where all your '.md' files are located
  // Fix: Cannot be an absolute path
  content_dir: path.join(__dirname, '..', 'content', 'pages'),

  // Where is the public directory or document root?
  public_dir: path.join(theme_dir, theme_name, 'public'),

  // The base URL of your images folder,
  // Relative to config.public_dir
  // (can use %image_url% in Markdown files)
  image_url: '/images',

  // Add your analytics tracking code (including script tags)
  analytics: '',

  // Set to true to enable the web editor
  allow_editing: true,

  // Set to true to enable HTTP Basic Authentication
  authentication: true,

  // If editing is enabled, set this to true to only authenticate for editing, not for viewing
  authentication_for_edit: true,

  // If authentication is enabled, set this to true to enable authentication for reading too
  authentication_for_read: false,

  // Google OAuth
  googleoauth: false,
  google_group_restriction: {
    enabled: false,
    api_key: 'GOOGLE_API_KEY',
    group_name: 'GOOGLE_GROUP_NAME',
  },
  oauth2: {
    client_id: 'GOOGLE_CLIENT_ID',
    client_secret: 'GOOGLE_CLIENT_SECRET',
    callback: 'http://localhost:3000/auth/google/callback',
    hostedDomain: 'google.com',
  },
  secret: 'someCoolSecretRightHere',

  // ##### WARNING #####
  // You MUST change the username and password for security
  // Do NOT use "admin" as a username as it's easily guessed.
  // You are encouraged to use tools to generate a password
  // Preferably, use a local password manager
  // If you absolutely must use an online tool, here are some suggestions
  // https://bitwarden.com/password-generator/
  // https://www.grc.com/passwords.htm
  credentials: [
    {
      username: 'admin',
      password: 'password',
    },
    {
      username: 'admin2',
      password: 'password',
    },
  ],

  locale: 'zh',

  // Support search with extra languages
  searchExtraLanguages: ['zh'],

  // Sets the format for datetime's
  datetime_format: 'Do MMM YYYY',

  // Set to true to render suitable layout for RTL languages
  rtl_layout: false,

  // Edit Home Page title, description, etc.
  home_meta: {
    // title       : 'Custom Home Title',
    // description : 'Custom Home Description'
  },

  // variables: [
  //   {
  //     name: 'test_variable',
  //     content: 'test variable'
  //   },
  //   {
  //     name: 'test_variable_2',
  //     content: 'test variable 2'
  //   }
  // ]

  // Set to true to enable generation of table of contents
  table_of_contents: false,

  // Configure generation of table of contents (see markdown-toc's docs for details on available options)
  table_of_contents_options: {
    // append: 'Table of contents appendix',
    // maxdepth: 6,
    // firsth1: true,
  },

  menu_on_pages: true,
  menu_on_page_collapsible: true,
};

// Exports
module.exports = config;

在config.js文件中,可以自行修改三个地方:

  • 站点名称
site_title: 'Raneto Docs',
  • 用户名和密码
credentials: [
    {
      username: 'admin',
      password: 'password',
    },
    {
      username: 'admin2',
      password: 'password',
    },
  ],
  • 支持中文语言
locale: 'zh',

  // Support search with extra languages
  searchExtraLanguages: ['zh'],

5.3 编辑docker-compose.yaml文件

新建raneto容器的docker-compose.yaml部署文件,内容如下:

version: "3.6"

services:
  raneto:
    image: raneto/raneto:latest
    container_name: raneto
    restart: always
    ports:
      - 7860:3000
    volumes:
      - /data/raneto/config:/opt/raneto/config
      - /data/raneto/content:/opt/raneto/content

5.4 创建raneto容器

使用docker-compose.yaml文件创建raneto容器

[root@jeven raneto]# docker compose up -d
[+] Running 2/2
 ⠿ Network raneto_default  Created                                                                                      0.1s
 ⠿ Container raneto        Started                                                                                      0.5s

5.5 检查raneto容器状态

检查raneto容器状态,确保raneto容器正常启动。

[root@jeven raneto]# docker compose ps
NAME                COMMAND                  SERVICE             STATUS              PORTS
raneto              "docker-entrypoint.s…"   raneto              running             0.0.0.0:7860->3000/tcp, :::7860->3000/tcp1.2.3.

5.6 检查raneto容器日志

检查raneto容器日志,确保raneto服务正常运行。

[root@jeven raneto]# docker compose logs
raneto  |
raneto  | > raneto@0.17.6 start
raneto  | > DEBUG=raneto node server.js
raneto  |
raneto  | 2023-12-05T09:06:05.706Z raneto Express HTTP server listening on port 3000

【Docker项目实战】使用Docker部署Raneto知识库平台_Docker

六、Raneto的基本使用

6.1 访问Raneto首页

访问地址:** http://192.168.3.166:7860/,将IP换为自己服务器IP地址,进入到Raneto首页。

【Docker项目实战】使用Docker部署Raneto知识库平台_docker_02

6.2 登录Raneto

使用默认的密码admin/password,登录Raneto。

【Docker项目实战】使用Docker部署Raneto知识库平台_docker_03

【Docker项目实战】使用Docker部署Raneto知识库平台_Markdown_04

6.3 上传文档

将md格式文件上传到宿主机的/data/raneto/content/pages目录下,刷新页面即可。

[root@jeven pages]# pwd
/data/raneto/content/pages
[root@jeven pages]# ls
Linux系统之ls命令的基本使用.md

【Docker项目实战】使用Docker部署Raneto知识库平台_docker_05

【Docker项目实战】使用Docker部署Raneto知识库平台_docker_06

6.4 新建页面目录

在宿主机的/data/raneto/content/pages目录下,新建Linux技术目录。

[root@jeven pages]# mkdir Linux技术
[root@jeven pages]# ls
Linux技术  Linux系统之ls命令的基本使用.md

重新刷新页面后,可以看到Linux技术目录。

【Docker项目实战】使用Docker部署Raneto知识库平台_Docker_07

七、总结

Raneto是一款简单高效的开源知识库工具,帮助我们整理知识文档和构建知识体系。它具有简洁直观的界面,可以轻松对文档进行分组管理。而且,它还提供了友好的Markdown支持,让我们能够以更加方便的编写和浏览技术文档。如果你正在寻找一个简单易用的知识库工具,那么Raneto是值得一试的选择。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1512904.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

Nodejs 第五十一章(限流阀)

限流功能 目前我们学习了redis,lua,nodejs&#xff0c;于是可以结合起来做一个限流功能&#xff0c;好比一个抽奖功能&#xff0c;你点击次数过多&#xff0c;就会提示请稍后重试&#xff0c;进行限制&#xff0c;我们来实现一下该功能。 安装依赖 npm i ioredis express代码…

git提交代码描述时如何换行(更新时间24/3/12)

问题复现&#xff08;信心满满使用转义字符换行&#xff09; 解决方法&#xff1a; 写多个-m字符串的结构可以实现自动换行 注意空格 git commit -m"第一行描述" -m"第二行描述" 效果演示&#xff1a;&#xff08;强迫症福利&#xff09;

【20240309】WORD宏设置批量修改全部表格格式

WORD宏设置批量修改全部表格格式 引言1. 设置表格文字样式2. 设置表格边框样式3. 设置所有表格边框样式为075pt4. 删除行参考 引言 这两周已经彻底变为office工程师了&#xff0c;更准确一点应该是Word工程师&#xff0c;一篇文档动不动就成百上千页&#xff0c;表格图片也是上…

导入空管基础数据

1、首先将data.tar.gz解压到自定义目录中 注意&#xff1a;由于数据文件的压缩包比较大&#xff0c;解压过程可能会持续3~5分钟&#xff0c;请耐心等待。 [rootnode3 ~]# cd /opt/software/ [rootnode3 software]# tar -xzf data.tar.gz -C /opt/ 2、利用SQLyog或者其他数据库…

鸿蒙不再适合JS语言开发

ArkTS是鸿蒙生态的应用开发语言。它在保持TypeScript&#xff08;简称TS&#xff09;基本语法风格的基础上&#xff0c;对TS的动态类型特性施加更严格的约束&#xff0c;引入静态类型。同时&#xff0c;提供了声明式UI、状态管理等相应的能力&#xff0c;让开发者可以以更简洁、…

力扣爆刷第93天之hot100五连刷51-55

力扣爆刷第93天之hot100五连刷51-55 文章目录 力扣爆刷第93天之hot100五连刷51-55一、200. 岛屿数量二、994. 腐烂的橘子三、207. 课程表四、208. 实现 Trie (前缀树)五、46. 全排列 一、200. 岛屿数量 题目链接&#xff1a;https://leetcode.cn/problems/number-of-islands/d…

基于YOLOv5的手机顶盖焊缺陷检测系统

&#x1f4a1;&#x1f4a1;&#x1f4a1;本文主要内容:详细介绍了工业手机顶盖焊缺陷测整个过程&#xff0c;从数据集到训练模型到结果可视化分析。 博主简介 AI小怪兽&#xff0c;YOLO骨灰级玩家&#xff0c;1&#xff09;YOLOv5、v7、v8优化创新&#xff0c;轻松涨点和模型…

Android 生成SO - 基础工程创建

最近需要给小伙伴扫盲一下如何使用Android Studio 生成一个SO文件&#xff0c;网上找了很多都没有合适的样例&#xff0c;那只能自己来写一个了。 原先生成SO是一个很麻烦的事情&#xff0c;现在Android Studio帮忙做了很多的事情&#xff0c;基本只要管好自己的C代码即可。 …

coreldraw是什么软件 矢量图设计软件推荐 CDR学习入门 CDR2024发布 cdr2024免费激活下载

CDR是一款平面设计软件&#xff0c;全称为CorelDRAW&#xff0c;是由Corel公司开发的矢量图形编辑工具套件。这款软件结合了矢量图形设计和页面布局的全功能&#xff0c;被广泛应用于商标设计、标志制作、模型绘制、插图描画、排版及分色输出等诸多领域。 2024年3月&#xff0…

STM32进阶笔记——FATFS文件系统(下)

本专栏争取每周三更新直到更新完成&#xff0c;期待大家的订阅关注&#xff0c;欢迎互相学习交流。 本文需要一些SD卡和内存管理等前置知识&#xff0c;后续文章会介绍&#xff0c;这里先介绍一下FATFS文件系统。关于FATFS的文章分为上下两篇&#xff0c;上篇主要介绍什么是FAT…

【C语言】tcp_transmit_skb

一、__tcp_transmit_skb讲解 这个函数 __tcp_transmit_skb() 是 Linux 内核中 TCP/IP 协议栈的一部分&#xff0c;负责处理传输控制协议&#xff08;TCP&#xff09;数据包的发送。具体来说&#xff0c;这个函数将 TCP 头部添加到一个没有任何头部信息的 socket buffer (sk_bu…

【大模型API调用初尝试二】星火认知大模型 百度千帆大模型

大模型API调用初尝试二 科大讯飞—星火认知大模型单论会话调用多轮会话调用 百度—千帆大模型获取access_token单轮会话多轮会话 科大讯飞—星火认知大模型 星火认知大模型是科大讯飞开发的&#xff0c;直接使用可以点击星火认知大模型&#xff0c;要调用API的话在讯飞开发平台…

python文本转语音的开源库介绍

本文介绍Python中用于文本转语音&#xff08;Text-to-Speech, TTS&#xff09;的三个开源库&#xff1a;pyttsx3、gtts和espeak。这些库可以在Windows平台上运行&#xff0c;并允许用户将文本转换为语音输出。 pyttsx3 pyttsx3是一个Python库&#xff0c;用于跨平台的文本到语音…

PLC远程故障诊断

随着工业自动化水平的不断提升&#xff0c;可编程逻辑控制器&#xff08;PLC&#xff09;在生产线控制、设备自动化等领域发挥着越来越重要的作用。然而&#xff0c;PLC在运行过程中难免会出现故障&#xff0c;影响生产线的稳定运行。因此&#xff0c;如何迅速、准确地诊断并解…

jenkins部署go应用 基于docker

丢弃旧的的构建 github 拉取代码 拉取代码排除指定配置文件 报错 环境变量失效 服务器版本为1.21.6 但是一直没有生效

HTML 01

1.html使用标签来表达 结束标签多一个/ <strong>文字内容</strong> <hr> 包裹内容就是双标签&#xff0c;换行等是单标签 浏览器中显示内容&#xff1a; 2.html的骨架是网页模板 <!DOCTYPE html> <html lang"en"> <head>&l…

惬意了解 —— 前端发展史

下拉底部&#xff0c;参与投票&#xff5e;&#xff5e; 前端发展史&#xff1a;从洪荒时代到现代 前端开发已经走过了将近20年的历程&#xff0c;从最早的纯静态页面到如今的现代前端框架&#xff0c;我们见证了前端技术的蓬勃发展。让我们一起回顾这段历史。 洪荒时代&…

WordPress供求插件API文档:获取市场类型

请注意&#xff0c;该文档为&#xff1a; WordPress供求插件&#xff1a;一款专注于同城生活信息发布的插件-CSDN博客文章浏览阅读396次&#xff0c;点赞6次&#xff0c;收藏5次。WordPress供求插件&#xff1a;sliver-urban-life 是一款专注于提供同城生活信息发布与查看的插件…

TypeScript 哲学 - index access types

We can use an indexed access type to look up a specific property on another type: 快速得到一个数组类型 和 得到一个对象数组中单个元素的类型 用 infer推出数组类型 &#xff08;typescript structure type &#xff1a; as long as my more than yours &#xff0…

耐腐蚀PFA气体洗涤瓶可多级串联透明特氟龙塑料氢气吸收装置

洗气瓶是一种常用于净化和干燥各种气体的实验室器皿&#xff0c;以去除其中的水分、油脂、颗粒物等杂质&#xff0c;从而使需要用到的气体满足实验要求。 PFA洗气瓶的工作原理&#xff1a; 主要是通过液体吸收、溶解或发生化学反应来去除气体中的杂质。在洗气过程中&#xff…