Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(docs): add autobuild and serving for docs #442

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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/"]
22 changes: 22 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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)
1 change: 1 addition & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ furo
sphinx
myst-parser
sphinx-copybutton
sphinx-autobuild
Loading