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

【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.mfbz.cn/a/452930.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

【数学建模】熵权法 Python代码

熵权法是一种客观的赋权方法&#xff0c;它可以靠数据本身得出权重。 依据的原理&#xff1a;指标的变异程度越小&#xff0c;所反映的信息量也越少&#xff0c;其对应的权值也应该越低。 import numpy as np#自定义对数函数mylog&#xff0c;用于处理输入数组中的0元素 def m…

OpenCV和Mediapipe实现摸嘴或鼻检测

目录 引言 1.过程简介 2. 代码结构 2.1 导入库 2.2 初始化模型 2.3 读取视频流或摄像头 2.4 初始化FPS计算 2.5 主循环 2.6 转换BGR图像为RGB图像 2.7 运行姿势检测模型和手部检测模型 2.8 绘制姿势关键点及连接线 2.9 检测手部关键点 2.10 判断手部与鼻子、嘴的相对…

300分钟吃透分布式缓存-28讲:如何构建一个高性能、易扩展的Redis集群?

Redis 集群的分布式方案主要有 3 种。分别是 Client 端分区方案&#xff0c;Proxy 分区方案&#xff0c;以及原生的 Redis Cluster 分区方案。 Client 端分区 Client 端分区方案就是由 Client 决定数据被存储到哪个 Redis 分片&#xff0c;或者由哪个 Redis 分片来获取数据。…

DVWA靶场-暴力破解

DVWA是一个适合新手锻炼的靶机&#xff0c;是由PHP/MySQL组成的 Web应用程序&#xff0c;帮助大家了解web应用的攻击手段 DVWA大致能分成以下几个模块&#xff0c;包含了OWASP Top 10大主流漏洞环境。 Brute Force——暴力破解 Command Injection——命令注入 CSRF——跨站请…

职场中的创新思维与执行力

在职场中&#xff0c;创新思维和执行力是两个关键要素。创新思维能够帮助员工在工作中找到更好的解决方案&#xff0c;而执行力则是将想法付诸实践的能力。本文将探讨如何在职场中培养创新思维和提升执行力。 一、创新思维的重要性 在职场中&#xff0c;创新思维是推动企业发展…

Docker容器化技术(互联机制实现便捷互访)

容器的互联是一种让多个容器中的应用进行快速交互的方式。它会在源和接收容器之间创建连接关系&#xff0c;接收容器可以通过容器名快速访问到源容器&#xff0c;而不用指定具体的IP地址。 1.自定义容器命名 连接系统依据容器的名称来执行。因此&#xff0c;首先需要自定义一…

Django 模版基本语法

Django学习笔记 模版语法 本质&#xff1a;在HTML中写一些占位符&#xff0c;由数据对这些占位符进行替换和处理。 views.py def page2(request):#定义一些变量将变量传送给templates中的html文件name1 sallyname2 yingyinghobbys [swimming,badminton,reading]person {…

惬意上手Redis

Redis介绍 Redis&#xff08;全称为REmote Dictionary Server&#xff09;是一个开源的、内存中的数据存储结构&#xff0c;主要用作应用程序缓存或快速相应数据库。 REmote Dictionary Server: 有道翻译Redis是“远程字典服务”&#xff0c;远程不过是远程访问&#xff0c;而…

Ingress 实战:从零到一构建高可用服务

Ingress 是 Kubernetes 中一种用于控制流量进入集群的资源。它可以为集群内的服务提供统一的访问入口&#xff0c;并提供一些额外的功能&#xff0c;例如&#xff1a; 路由流量到不同的服务 提供基于路径的路由 提供基于主机的路由 提供 TLS 加密 使用身份验证和授权 Ing…

SQL: 触发器/存储过程/游标的操作

目录 触发器存储过程创建存储过程修改存储过程删除存储过程执行存储过程 游标待续、更新中 触发器 待更新存储过程 定义 是一组TSQL语句的预编译集合&#xff0c;能实现特定的功能 是一种独立的数据库对象&#xff0c;在服务器上创建和运行 类似于编程语言中的过程或函数分类…

SublimeText4 安装

Sublime Text 可以编写html&#xff0c;css&#xff0c;js&#xff0c;php等等&#xff0c;是一个轻量、简洁、高效、跨平台的编辑器。 图1&#xff1a;SublimeText官网 Sublime Text具有漂亮的用户界面和强大的功能&#xff0c;例如代码缩略图&#xff0c;Python的插件&#…

Java学习记录(十九)多线程(一)

线程 线程是操作系统能进行调度的最小单位&#xff0c;他是被包含在进程中的&#xff0c;一个运行的软件可以看作为一个进程&#xff0c;而在该软件中执行的各种功能自身可以理解为一个线程&#xff0c;可以理解为在软件中互相独立又可以同时进行的功能&#xff0c;他是进程中…

js视频上传的方法

一、视频上传于图片上传类似他们的上传方法一样。路径不同标签不同&#xff1b; 二、直接上效果 三、直接上代码 // // 上传图片 let urls "https://wwz.jingyi.icu/"; let a $("form img") // console.log(a);function fl() {let read document.getE…

计算机网络面经八股-解释一下HTTP长连接和短连接?

在HTTP/1.0中&#xff0c;默认使用的是短连接。也就是说&#xff0c;浏览器和服务器每进行一次HTTP操作&#xff0c;就建立一次连接&#xff0c;但任务结束就中断连接。如果客户端浏览器访问的某个HTML或其他类型的 Web页中包含有其他的Web资源&#xff0c;如JavaScript文件、图…

探索制氮机在农产品保鲜中的应用方式

在现代生活中&#xff0c;农产品保鲜成为老生常谈的话题&#xff0c;水果数次厂商总是在为如何使水果蔬菜能够保存时间长一点而发愁&#xff0c;而制氮机的出现则解决了这一难题&#xff0c;为农产品保鲜技术带来了革命性的变革。本期恒业通小编和您一起了解制氮机在水果,蔬菜保…

k8s+wordpress+zabbix+elastic+filebeat+kibana服务搭建以及测试

一&#xff0c;环境&#xff1a;docker&#xff0c;k8s&#xff0c;zabbix&#xff0c;以及搭建worpdress&#xff0c;elasticsearch&#xff0c;filebeat&#xff0c;kibana 二&#xff0c;主机分配&#xff1a; 名称host详述个人博客3192.168.142.133 搭配mysql8.0.36的数据…

ubuntu安装并使用Anaconda

0、说明 对应着 Python 有 2.x 版本和 3.x 版本&#xff0c;Anaconda 也有 Anaconda2 以及 Anaconda 3 两个版本&#xff0c;考虑其流行度&#xff0c;一般谈及 Anaconda 时&#xff0c;默认为 Anaconda3。本人使用的ubuntu20.04。 1、Anaconda 简介 Anaconda 是一个用于科学…

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

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

基于YOLOv8/YOLOv7/YOLOv6/YOLOv5的交通信号灯识别系统(深度学习+UI界面+训练数据集+Python代码)

摘要&#xff1a;本研究详细介绍了一种采用深度学习技术的交通信号灯识别系统&#xff0c;该系统集成了最新的YOLOv8算法&#xff0c;并与YOLOv7、YOLOv6、YOLOv5等早期算法进行了性能评估对比。该系统能够在各种媒介——包括图像、视频文件、实时视频流及批量文件中——准确地…

Xilinx 7系列FPGA的配置流程

目录 1.4配置流程 1.4.1 设备上电 ​编辑1.4.2 清除配置寄存器 1.4.3 采样模式引脚 1.4.4 同步 ​编辑1.4.5 检测设备ID ​编辑1.4.6 加载配置数据 1.4.7 CRC校验 1.4.8 启动序列 1.4配置流程 对于所有配置模式&#xff0c;7系列的基本配置流程都是相同的&…