Sign inSign up

containinger/docker-mdwiki

By containinger

Updated almost 8 years ago

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

Image
0

656

containinger/docker-mdwiki repository overview

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

Tag summary

Content type

Image

Digest

Size

35.1 MB

Last updated

almost 8 years ago

docker pull containinger/docker-mdwiki