ff03b05e077377288cae37ea2abea0a5ab495a81
ubumtu/gollum.md
... | ... | @@ -0,0 +1,77 @@ |
1 | +Ubuntu20.04上で構築した。 |
|
2 | + |
|
3 | +### dockerのインストール |
|
4 | +``` |
|
5 | +$ sudo snap install docker |
|
6 | +``` |
|
7 | + |
|
8 | +### gollumの構築 |
|
9 | +[Gollum via Docker · gollum/gollum Wiki](https://github.com/gollum/gollum/wiki/Gollum-via-Docker) |
|
10 | + |
|
11 | +``` |
|
12 | +$ mkdir ~/gollum |
|
13 | +$ cd gollum |
|
14 | +``` |
|
15 | + |
|
16 | +Dockerfile(Wikiの通り) |
|
17 | +``` |
|
18 | +$ nano Dockerfile |
|
19 | +``` |
|
20 | +``` |
|
21 | +FROM ruby |
|
22 | +RUN apt-get -y update && apt-get -y install libicu-dev cmake && rm -rf /var/lib/apt/lists/* |
|
23 | +RUN gem install github-linguist |
|
24 | +RUN gem install gollum |
|
25 | +RUN gem install org-ruby # optional |
|
26 | +WORKDIR /wiki |
|
27 | +ENTRYPOINT ["gollum", "--port", "80"] |
|
28 | +EXPOSE 80 |
|
29 | +``` |
|
30 | +ビルドする |
|
31 | +``` |
|
32 | +$ docker build -t gollum . |
|
33 | +``` |
|
34 | +HTTPS対応のため、`https-portal`イメージを利用する。[SteveLTN/https-portal: A fully automated HTTPS server powered by Nginx, Let's Encrypt and Docker.](https://github.com/SteveLTN/https-portal) |
|
35 | +編集不可モードのgollumと、BASIC認証のかかった編集可のgollumをそれぞれ別ドメインで動かす感じ。共に同じgitレポジトリを参照する。 |
|
36 | +``` |
|
37 | +$ nano docker-compose.yml |
|
38 | +``` |
|
39 | +``` |
|
40 | +version: "2" |
|
41 | + |
|
42 | +volumes: |
|
43 | + gollum-data: |
|
44 | + driver: local |
|
45 | + driver_opts: |
|
46 | + type: none |
|
47 | + device: $PWD/gollum-page |
|
48 | + o: bind |
|
49 | + |
|
50 | +services: |
|
51 | + gollum-viewer: |
|
52 | + image: gollum |
|
53 | + volumes: |
|
54 | + - gollum-data:/wiki |
|
55 | + entrypoint: ["gollum", "-p", "80", "--no-edit"] |
|
56 | + |
|
57 | + gollum-editor: |
|
58 | + image: gollum |
|
59 | + volumes: |
|
60 | + - gollum-data:/wiki |
|
61 | + |
|
62 | + https-portal: |
|
63 | + image: steveltn/https-portal:1 |
|
64 | + ports: |
|
65 | + - '80:80' |
|
66 | + - '443:443' |
|
67 | + links: |
|
68 | + - gollum-viewer |
|
69 | + restart: always |
|
70 | + environment: |
|
71 | + DOMAINS: 'wiki.takanotume24.com -> http://gollum-viewer:80, [管理ユーザー名]:[パスワード]@admin.wiki.example.com -> http://gollum-editor:80' |
|
72 | + STAGE: 'production' |
|
73 | +``` |
|
74 | +起動する |
|
75 | +``` |
|
76 | +$ sudo docker-compose up |
|
77 | +``` |
|
... | ... | \ No newline at end of file |