From 2c8f562d782d872a4d3944343503fdba10bffe99 Mon Sep 17 00:00:00 2001 From: shreddedbacon Date: Wed, 9 Oct 2024 15:36:03 +1100 Subject: [PATCH] docs: add make target for serving docs locally in docker --- Makefile | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Makefile b/Makefile index d1e2d3f9f2..69e7ac8fc2 100644 --- a/Makefile +++ b/Makefile @@ -76,6 +76,10 @@ PUBLISH_PLATFORM_ARCH := linux/amd64,linux/arm64 # Skip image scanning by default to make building images substantially faster SCAN_IMAGES := false +# Settings for the MKDocs serving +MKDOCS_IMAGE ?= ghcr.io/amazeeio/mkdocs-material +MKDOCS_SERVE_PORT ?= 8000 + # Init the file that is used to hold the image tag cross-reference table $(shell >build.txt) $(shell >scan.txt) @@ -795,3 +799,12 @@ k3d/clean-k3dconfigs: .PHONY: k3d/clean-all k3d/clean-all: k3d/clean k3d/clean-k3dconfigs k3d/clean-charts + +.PHONY: docs/serve +docs/serve: + @echo "Starting container to serve documentation" + @docker run --rm -it \ + -p 127.0.0.1:$(MKDOCS_SERVE_PORT):$(MKDOCS_SERVE_PORT) \ + -v ${PWD}:/docs \ + --entrypoint sh $(MKDOCS_IMAGE) \ + -c 'mkdocs serve --dev-addr=0.0.0.0:$(MKDOCS_SERVE_PORT) -f mkdocs.yml'