Skip to content

mkdocs#

description:#

mkdocs is a program for taking files that have been written using markdown language and generating a website for publication. In addition to the files, you require a configuration file which identifies the page structure. Mkdocs supports the application of themes to the pages to ensure a consistent look and feel to the site. material for mkdocs is used here.

mkdocs image

source and credits: docker image - polinux/mkdocs:1.1.0

usage#

The program runs continuously and enables a live view. Site changes can be previewed on the local url: http://localhost:8001

To release a copy to the published site, open a terminal window in portainer (|> icon) for the mkdocs container. Then run the following commands to reload the website.

cd docs/
mkdocs build

This will update the contents of the /site folder which is shared with the apache webserver application.

dependencies#

preparation: create some folders for persistent storage outside of the docker container.

  1. mkdocs
  2. mkdocs/docs
  3. mkdocs/site

installation#

create a stack in portainer with the following code.

 version: '2'  
   services:  
     mkdocs:  
     container_name: mkdocs  
     image: polinux/mkdocs:1.1.0  
     restart: unless-stopped  
     ports:  
       - "8001:8000"

     environment:  
       - LIVE_RELOAD_SUPPORT=false  
       - ADD_MODULES=fontawesome-markdown mkdocs-material  
       - FAST_MODE=true  
       - DOCS_DIRECTORY=/docs  
       - SITE_DIRECTORY=/site  
       - UPDATE_INTERVAL=15  
       - AUTO_UPDATE=true

     volumes:  
       - /var/lib/docker/volumes/myconfigs/_data/mkdocs/docs:/docs  
       - /var/lib/docker/volumes/myconfigs/_data/mkdocs/site:/site