Skip to content

Gollum via docker compose

Jim Meyer edited this page Sep 24, 2023 · 8 revisions

Please note: the instructions below assume the following directory structure, with the actual git repository wikidata contained in the root directory gollum-wiki:

gollum-wiki $ tree -a
.
├── config.rb
├── docker-compose.yml
├── gitconfig
└── wikidata
    ├── .git
    └── Home.md

If you want to place your docker-compose.yml and/or your config.rb file in the same directory as the wiki files, you need to change docker-compose.yml to reflect these different locations. So e.g. ${PWD}:/wiki instead of ${PWD}/wikidata:/wiki.

Instructions

  1. Create the root folder:
mkdir gollum-wiki && cd gollum-wiki
  1. Initialize the necessary files and repositories:
touch config.rb gitconfig
mkdir wikidata && git init wikidata
  1. Fill the config.rb file with all your favourite options.

  2. Mark the container's /wiki directory as safe for the container user (www-data) to trust.

git config --file gitconfig --add safe.directory /wiki

Without this, you will get this error when trying to access your gollum wiki: repository path '/wiki/' is not owned by current user. See the GitHub CVE-2022-24765 announcement for more details.

  1. Create docker-compose.yml:
version: "3.7"

services:
  gollum:
    image: gollumwiki/gollum:master
    restart: always
    ports:
      - "80:4567/tcp"
    volumes:
      - ${PWD}/config.rb:/etc/gollum/config.rb
      - ${PWD}/gitconfig:/home/www-data/.gitconfig
      - ${PWD}/wikidata:/wiki
    command:
      - "--config=/etc/gollum/config.rb"
  1. Start gollum in the background: docker-compose up -d