wiki 搭建指南

wiki.js 参考文档:https://docs.requarks.io/

Docker 环境下安装指南

  • 安装 docker 依赖包
$ sudo yum install -y yum-utils
  • 配置国内 docker 镜像
$ sudo yum-config-manager \
    --add-repo \
    https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
    
$ sudo sed -i 's/download.docker.com/mirrors.aliyun.com\/docker-ce/g' /etc/yum.repos.d/docker-ce.repo
  • 安装 docker
$ sudo yum install docker-ce docker-ce-cli containerd.io
  • 启动 docker
$ sudo systemctl enable docker             # docker 后台运行
$ sudo systemctl start docker              # docker 启动
  • 启动 docker 验证
$ sudo docker run hello-world
  • 安装 docker compose,选择最新版本的进行安装
$ curl -L https://github.com/docker/compose/releases/download/1.23.2/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
$ chmod +x /usr/local/bin/docker-compose
  • 验证 docker compose
$ docker-compose version
  • 在 root 根目录下新建 docker-compose.yml
services:

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

  wiki:
    image: requarks/wiki:2
    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 compose 服务
$ docker-compose up -d
  • 登录网站进行其他 wiki 配置

你可能感兴趣的:(wiki 搭建指南)