diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..dc63b810 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM python:3.12-slim + +WORKDIR /app + +COPY docs/requirements.txt . +COPY docs/ docs/ + +RUN pip install uv +RUN uv pip install -r requirements.txt --system + +EXPOSE 8000 + +CMD ["sphinx-autobuild", "docs/", "docs/_build/", "--host", "0.0.0.0", "--port", "8000", "-j", "auto", "--watch", "docs/"] diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..2396b696 --- /dev/null +++ b/Makefile @@ -0,0 +1,22 @@ +DOCKER_IMAGE_NAME := docs-server +DOCKER_CONTAINER_NAME := docs-container + +.PHONY: docs-build docs-clean docs-serve + +docs-build: + @echo "=> Building Docker image for documentation" + docker build -t $(DOCKER_IMAGE_NAME) -f Dockerfile . + +docs-clean: + @echo "=> Cleaning documentation build assets" + docker run --rm -v $(PWD)/docs:/app/docs $(DOCKER_IMAGE_NAME) rm -rf /app/docs/_build + @echo "=> Removed existing documentation build assets" + +docs-serve: docs-build + @echo "=> Serving documentation" + docker run --name $(DOCKER_CONTAINER_NAME) -p 8000:8000 -v $(PWD)/docs:/app/docs $(DOCKER_IMAGE_NAME) + +docs-stop: + @echo "=> Stopping documentation server" + docker stop $(DOCKER_CONTAINER_NAME) + docker rm $(DOCKER_CONTAINER_NAME) \ No newline at end of file diff --git a/docs/requirements.txt b/docs/requirements.txt index 4072332b..0c3ef1f5 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -2,3 +2,4 @@ furo sphinx myst-parser sphinx-copybutton +sphinx-autobuild