docker-compose WiKi.js

참고페이지: https://docs.requarks.io/wiki/install/docker#using-docker-compose

 

wiki 디렉토리 생성 및 docker-compose.yml 파일생성

test@docker-test:~/Workspace$ mkdir wiki 
test@docker-test:~/Workspace/wiki$ vi docker-compose.yml
version: "3"
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:

 

wikijs config.yml 파일 생성

sample 파일 : https://docs.requarks.io/install/docker

수정할 부분은 아래 내용참고

test@docker-test:~/Workspace/wiki$ vi config.yml

host: http://192.168.0.100

port: 3000

test@docker-test:~/Workspace/wiki$ docker-compose up -d --build
test@docker-test:~/Workspace/wiki$ docker ps
CONTAINER ID        IMAGE                COMMAND                  CREATED             STATUS              PORTS                            NAMES
2178f46ab155        requarks/wiki:2      "docker-entrypoint.s…"   56 minutes ago      Up 56 minutes       3443/tcp, 0.0.0.0:80->3000/tcp   wiki_wiki_1
56a292756816        postgres:11-alpine   "docker-entrypoint.s…"   56 minutes ago      Up 56 minutes       5432/tcp                         wiki_db_1

 

 

 

 

 

ubuntu WiKi.js install

 

Git install

test@docker-test:~$ sudo add-apt-repository -y ppa:git-core/ppa
test@docker-test:~$ sudo apt update && sudo apt upgrade
test@docker-test:~$ sudo apt install git

 

Nodejs install

test@docker-test:~$ sudo apt install curl
test@docker-test:~$ curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
test@docker-test:~$ sudo apt install -y nodejs
test@docker-test:~$ sudo apt install mongodb

 

Wiki-js install

test@docker-test:~$ sudo mkdir -p /var/www/wikijs
test@docker-test:~$ cd /var/www/wikijs/
test@docker-test:/var/www/wikijs$ curl -sSo- https://wiki.js.org/install.sh | sudo bash
 __    __ _ _    _    _
/ / /\ \ (_) | _(_)  (_)___
\ \/  \/ / | |/ / |  | / __|
 \  /\  /| |   <| |_ | \__ \
  \/  \/ |_|_|\_\_(_)/ |___/
                   |__/
   < INSTALL >

[1/3] Fetching latest build...
[2/3] Fetching dependencies...
[3/3] Creating config file...
-> Installation Complete

Thank you for installing Wiki.js!
Please consider donating to our open collective to help maintain this project:
https://opencollective.com/wikijs/donate

- Launch configuration wizard: node wiki configure
- Start Wiki.js server: node wiki start

test@docker-test:/var/www/wikijs$

test@docker-test:/var/www/wikijs$ sudo node wiki configure

 

 

 

 

 

 

 

 

SKIP THIS STEP 으로 Git 설정 부분은 넘어갑니다.

 

 

 

 

Configure 가 끝나면 자동적으로 wiki js 가 정지 합니다.

test@docker-test:/var/www/wikijs$ sudo node wiki configure
⠴ Browse to http://localhost:3000 to configure Wiki.js!
✔ Wiki.js is now running in normal mode!
test@docker-test:/var/www/wikijs$

 

WiKi.js config 파일 수정및 WiKi.js 실행

test@docker-test:/var/www/wikijs$ pwd
/var/www/wikijs
test@docker-test:/var/www/wikijs$ vi config.yml
title: Wiki
#host: 'http://localhost'
host: 'http://192.168.0.100'
port: 80
test@docker-test:/var/www/wikijs$ sudo node wiki start
✔ Wiki.js has started successfully.
test@docker-test:/var/www/wikijs$