Nethence NEWDOC OLDDOC Lab Webmail Your IP BBDock  

Setting up Gollum within a docker container

Based on custom/ubuntu

Run the container that will serve Gollum,

netstat -an --inet --inet6 | grep LISTEN
app=gollumprod
docker ps -a | grep $app
docker run -d --name $app -h $app \
        -p 80XX:8080 -p 84XX:8443 \
        --volume /data/$app:/$app \
        gollum.nodoc
        #sma/ubuntucustom
docker ps -a | grep $app
docker logs $app

Enter the container,

app=gollumprod
docker exec -ti $app bash

Installation

Install the needed packages as root,

apt -y install ruby ruby-dev zlib1g-dbg zlib1g-dev libicu-dev
apt -y install make build-essential
gem install gollum
gem install bundle

then as user (you can stay root if it’s a container),

cd ~/
apt -y install git
#git clone https://github.com/gollum/gollum.git
git clone https://github.com/sekhmeth13/gollum-tweaked.git
cd gollum/
bundle install

GIT setup to handle the documentation

Setup the TERM & EDITOR vars for versioning comments,

export TERM=xterm
export EDITOR=vi
#ubuntu,
#update-alternatives --config editor

Setup your git profile,

#git config --global user.email "xxx@xxx"
#git config --global user.name "xxx"
git config --global user.email "user@example.com"
git config --global user.name "ISA support"

Create a local repository,

cd ~/
git init doc
cd doc/
vi check.md
git add check.md
git commit
git status

Setup the user account to have the same UID and GID as the docker host user, so the doc can be edited both ways, from the docker host+git commit or tru the Gousermexample.come,

groupadd -g 1002 buyin
useradd -m -u 1002 -g 1002 buyin
chmod 755 /root/
su - buyin
cd /root/doc/
bundle exec bin/gollum ../doc --port 8082

Ready to go

Backup the container as an image and allow to re-use it afterwards to re-launch other containers,

docker commit -p gollumprod gollum.ready.`date +%s`

Start the daemon,

#!/bin/ksh
set -e
cd gollum/
#bundle exec bin/gollum --help
bundle exec bin/gollum ../doc --config config.rb

Check with a web browser,

http://SERVER ADDRESS:4567/

and eventually enable a reverse-proxy against it.

References