---
# System prepended metadata

title: '[wiki]docker安裝配置wiki'
tags: [confluence]

---

# [wiki]docker安裝配置wiki
###### tags `consul`
:::info
:bulb: 舉例版本號為 2
:::
## :triangular_flag_on_post: 安裝並運行

:::warning
編輯一個docker-compose.yml
vim docker-compose.yml
:::

```yaml
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: ghcr.io/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:
      - "3000:3000"
 
volumes:
  db-data:
```

:::warning
啟動服務
docker-compose up -d
:::

![](https://i.imgur.com/dg8Armv.png)


## :triangular_flag_on_post: 測試訪問

訪問wiki.js  http://localhost:3000
會叫你創建一個Admin帳號

![](https://i.imgur.com/plhYblX.png)

安裝完成就會跳出登入畫面了

![](https://i.imgur.com/4FaQASp.png)

後面就靠大家摸索補充了

![](https://i.imgur.com/6ibue4b.png)

可以編輯個文章試試看

![](https://i.imgur.com/AtQeIgK.png)

