Skip to content

Repository files navigation

dok2docker

A flexible technical documentation solution based on Hugo and an nginx webserver.

Write content in markdown, generate a static website with Hugo using the Doks template, and serve it from a container powered by nginx — all orchestrated by a single multi-stage Dockerfile.

How it works

markdown files  →  Hugo + Doks  →  static HTML  →  nginx (Podman)
Layer Technology Role
Content Markdown Human-readable source files
Build Hugo + Doks theme Converts markdown to a static HTML site
Serve Podman + nginx Packages and serves the static site

Quick start

# Build the container image
podman build -t dok2docker .

# Run the documentation server
podman run --rm -p 8888:80 dok2docker

Open http://localhost:8888 in your browser.

Configuring the base URL

Hugo bakes the baseURL into the static site at build time. The default is http://localhost:8888. To use a different host or port, pass the BASE_URL build argument:

podman build --build-arg BASE_URL=http://myserver:9090 -t dok2docker .
podman run --rm -p 9090:80 dok2docker

Local development

# Install Node.js dependencies (includes the Doks theme)
npm install

# Start the Hugo development server with live reload
npm run dev

The development server starts at http://localhost:1313.

Content

Documentation pages live under content/docs/. Add or edit .md files to update the site:

content/docs/
├── prologue/
│   └── introduction.md    # Getting started and architecture overview
└── jenkins/
    └── pipeline-demo.md   # Declarative Jenkins pipeline for a Maven project

The included demo describes a basic declarative Jenkins pipeline that executes mvn clean deploy and mvn test for the Spring Boot Getting Started sample Maven project.

References

About

Project documentation with markdown and a Docker webserver

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages