Skip to content

Commit

Permalink
docs: add make target for serving docs locally in docker
Browse files Browse the repository at this point in the history
  • Loading branch information
shreddedbacon committed Oct 9, 2024
1 parent 1cf5c76 commit 4614fc5
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -761,3 +765,12 @@ k3d/clean: local-dev/k3d
ifeq ($(ARCH), darwin)
docker rm --force $(CI_BUILD_TAG)-k3d-proxy-32080 || true
endif

.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'

0 comments on commit 4614fc5

Please sign in to comment.