wiki.js知识库搭建及问题记录

1. 部署环境

 

系统版本: OpenEuler22.03-LTS2

wiki.js版本:docker版

 

安装docker

yum -y install docker

安装docker-compose

 curl -L https://github.com/docker/compose/releases/download/1.16.1/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose

或 

 wget https://github.com/docker/compose/releases/download/1.25.1/docker-compose-`uname -s`-`uname -m`  -O /usr/local/bin/docker-compose-1.25.1 --no-ch

或 v2下载(v2太大,下载非常慢)

curl -L https://github.com/docker/compose/releases/download/v2.23.3/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose-v2.23.3

 

2. docker拉取镜像

docker search postgres

docker pull mysql

docker pull postgres

docker pull requarks/wiki

 

docker-compose脚本

# cat wiki.js.yml
version: "3"
services:

  db:
    image: postgres:latest
    environment:
      POSTGRES_DB: wiki
      POSTGRES_PASSWORD: wikijsrocks
      POSTGRES_USER: wikijs
    logging:
      driver: "none"
    restart: unless-stopped
    volumes:
      - /data:/var/lib/postgresql/data


  wiki:
    image: requarks/wiki:latest
    depends_on:
      - db
    environment:
      DB_TYPE: postgres
      DB_HOST: db
      DB_PORT: 5432
      DB_USER: wikijs
      DB_PASS: wikijsrocks
      DB_NAME: wiki
    restart: unless-stopped
    ports:
      - "80:3000"

volumes:
  db-data:

 

 

如果docker需要用普通用户运行可如下操作

grep docker /etc/group||groupadd docker # 有则不用创建

usermod -aG docker $USER  # USER 为加入 docker 组的用户

newgrp docker # 刷新 docker 组 


或
chmod  777 /usr/bin/docker

 

 端口问题,如果wiki tcp4的端口无法访问

grep net.ipv4.ip_forward /etc/sysctl.conf&& sed -i '/net.ipv4.ip_forward/s/0/1/' /etc/sysctl.conf||echo 'net.ipv4.ip_forward=1' >> /etc/sysctl.conf

 

 

初始化设置随便填,自己能记住就行

 

进入administration管理区

 

语言设置:侧边栏选择语言包-->下载中文包-->切换到中文-->提交

 

退出管理区,创建页面

 

posted @ 2023-12-27 10:12  咿呀哒喏  阅读(539)  评论(1编辑  收藏  举报