将基础设施研讨会的GROWI变为可同时编辑的选项
这是“基础设施学习会Advent Calendar”的第21篇文章。
开头
在基础设施学习会中,可以说最古老的服务是wiki系统“GROWI”。
在这个学习会上,我们从“Crowi-Plus”的早期版本开始使用它,最近似乎已经进行了容器化。
- インフラ勉強会wiki
步骤
由于 GROWI v3.2.0 对 HackMD 进行了支持,使得维基的同时编辑成为可能,所以我们只能添加这个功能。
现在的版本是
GROWI 3.3.3
创建适用于HackMD的容器。
$cd growi
$vim docker-compose.override.yml ←新規作成
docker-compose.override.yml的中文翻译为:
docker-compose覆盖.yml
version: '3'
services:
##
# HackMD(CodiMD) container
# see https://github.com/hackmdio/codimd#configuration
#
hackmd:
build:
context: ./hackmd
environment:
- GROWI_URI=https://wiki.infra-workshop.tech
- HMD_DB_URL=mysql://hackmd:hackmdpass@mariadb:3306/hackmd
- HMD_CSP_ENABLE=false
ports:
- 3100:3000 # localhost only by default
depends_on:
- mariadb
##
# MariaDB
# see https://hub.docker.com/_/mariadb/
mariadb:
image: mariadb:10.3
command: mysqld --character-set-server=utf8 --collation-server=utf8_general_ci
environment:
- MYSQL_USER=hackmd
- MYSQL_PASSWORD=hackmdpass
- MYSQL_DATABASE=hackmd
- MYSQL_RANDOM_ROOT_PASSWORD=true
volumes:
- mariadb_data:/var/lib/mysql
volumes:
mariadb_data:
编辑docker-compose.yml文件
$vim docker-compose.yml
docker-compose.yml 文件
version: '3'
services:
app:
build:
context: .
dockerfile: ./Dockerfile
ports:
- 3000:3000 # localhost only by default
links:
- mongo:mongo
- elasticsearch:elasticsearch
depends_on:
- mongo
- elasticsearch
environment:
- MONGO_URI=mongodb://mongo:27017/growi
- ELASTICSEARCH_URI=http://elasticsearch:9200/growi
- PASSWORD_SEED=changeme
# - FILE_UPLOAD=local # activate this line if you use local storage of server rather than AWS
# - MATHJAX=1 # activate this line if you want to use MathJax
# - PLANTUML_URI=http:// # activate this line and specify if you use your own PlantUML server rather than public plantuml.com
- HACKMD_URI=https://hackmd.infra-workshop.tech # activate this line and specify HackMD server URI which can be accessed from GROWI client browsers # コメントアウトを解除
- HACKMD_URI_FOR_SERVER=http://hackmd:3000 # activate this line and specify HackMD server URI which # コメントアウトを解除
- can be accessed from this server container # 追加
command: "dockerize
-wait tcp://mongo:27017
-wait tcp://elasticsearch:9200
-timeout 60s
npm run server:prod"
volumes:
- growi_data:/data
mongo:
image: mongo:3.4
volumes:
- mongo_configdb:/data/configdb
- mongo_db:/data/db
elasticsearch:
image: elasticsearch:5.3-alpine
environment:
- "ES_JAVA_OPTS=-Xms256m -Xmx256m" # increase amount if you have enough memory
command:
- sh
- -c
- "./bin/elasticsearch-plugin list | grep -q analysis-kuromoji || ./bin/elasticsearch-plugin install analysis-kuromoji;
./bin/elasticsearch-plugin list | grep -q analysis-icu || ./bin/elasticsearch-plugin install analysis-icu;![Bad Request]()
/docker-entrypoint.sh elasticsearch"
volumes:
- es_data:/usr/share/elasticsearch/data
- es_plugins:/usr/share/elasticsearch/plugins
- ./esconfig:/usr/share/elasticsearch/config
volumes:
growi_data:
mongo_configdb:
mongo_db:
es_data:
es_plugins:
使用docker-compose启动
$ docker-compose up -d
进行端口开放,以便从WAN侧可以访问tcp3100端口。
以上 – the above