Skip to content
This repository has been archived by the owner on Jul 30, 2020. It is now read-only.
/ docker-mdwiki Public archive

Docker container for hosting and auto-updating an MDwiki instance.

License

Notifications You must be signed in to change notification settings

nefarius/docker-mdwiki

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 

Repository files navigation

docker-mdwiki

Lightweight docker image hosting an MDwiki instance with content fetched from a GitHub repository.

About

docker-mdwiki is a simple and light container based on the Linux Alpine image. Upon startup it clones a specified GitHub repositository and serves its content with devd. Additionally it listens for an incoming Github Webhook and automatically pulls changes upon receiving a push notification. Webhooks are processed by the included webhook server. These services are managed by supervisord. The services themselves run under an unprivileged user.

Build

docker build -t containinger/docker-mdwiki https://github.com/nefarius/docker-mdwiki.git#master

Run

Standalone

docker run --name=docker-mdwiki \
    --restart=always \
    -e GIT_CLONE_URL=https://github.com/ViGEm/docs.vigem.org.git \
    -e WEBHOOK_ID=4648cc7a-f8aa-4705-90a2-d7958d57d462 \
    -e WEBHOOK_SECRET=y9b3nTwR95ejCgNZ \
    -p 127.0.0.1:1601:8000 \
    -p 127.0.0.1:1602:9000 \
    -d containinger/docker-mdwiki:latest

Compose file

version: "3"

services:
  mdwiki:
    image: containinger/docker-mdwiki:latest
    container_name: mdwiki
    environment:
      - GIT_CLONE_URL=https://github.com/ViGEm/docs.vigem.org.git
      - WEBHOOK_ID=4648cc7a-f8aa-4705-90a2-d7958d57d462
      - WEBHOOK_SECRET=y9b3nTwR95ejCgNZ
    ports:
      - "127.0.0.1:1601:8000"
      - "127.0.0.1:1602:9000"
    restart: always

Nginx as reverse proxy

This snippet exposes the Wiki at the root of http://example.org while a push notification can be sent to http://example.org/hooks/4648cc7a-f8aa-4705-90a2-d7958d57d462 (matching the ID referenced in the environment variable).

server {
  listen 80;
  server_name example.org;

  location / {
    proxy_pass http://127.0.0.1:1601;
  }

  location /hooks {
    proxy_pass http://127.0.0.1:1602;
  }
}

GitHub Webhook example configuration

Webhook