From 653913cfc01c0b5605e348dbed1b4dc7b5c61ef0 Mon Sep 17 00:00:00 2001 From: Xueqin Cui Date: Mon, 16 Feb 2026 16:32:22 +1100 Subject: [PATCH 1/5] docs: add instructions for running docs locally --- docs/README.md | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/docs/README.md b/docs/README.md index 5d078579817..cb122ae93a6 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,6 +1,26 @@ -# OpenAPI generation +# README -## Prerequisites +The [OSV.dev docs](https://osv.dev/docs) are hosted on [GitHub Pages](https://pages.github.com/). + +## Running docs locally + +To run the docs locally: + +- Install `ruby (>= 3.1.0)`. This should come with `bundler`. + - On Debian, you need to install them separately: + - `ruby` + - `ruby-bundler` +- In this directory: + - `bundle install` + - `bundle exec jekyll serve` + +Here's the full documentation on GitHub for [running Jekyll locally]. + +[running Jekyll locally]: https://docs.github.com/en/pages/setting-up-a-github-pages-site-with-jekyll/testing-your-github-pages-site-locally-with-jekyll#building-your-site-locally + +## OpenAPI generation + +### Prerequisites Install `protoc` for your platform: @@ -28,8 +48,8 @@ To install the protobuf service converter, run: go mod download ``` -## Generation +### Generation -``` +```bash python3 ./build_swagger.py ``` From f307620e6e77f1cc7a4171c4ffbeca2de2a45a32 Mon Sep 17 00:00:00 2001 From: Xueqin Cui Date: Mon, 16 Feb 2026 16:48:18 +1100 Subject: [PATCH 2/5] instructions for running docs in docker --- docs/README.md | 11 ++++++++++- docs/docs.Dockerfile | 23 +++++++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 docs/docs.Dockerfile diff --git a/docs/README.md b/docs/README.md index cb122ae93a6..acf260ff58f 100644 --- a/docs/README.md +++ b/docs/README.md @@ -2,7 +2,16 @@ The [OSV.dev docs](https://osv.dev/docs) are hosted on [GitHub Pages](https://pages.github.com/). -## Running docs locally +## Running docs locally (docker) + +You can run the docs locally consistently through docker: + +```bash +docker build -t osvdev-docs -f docs.Dockerfile . +docker run -p 4000:4000 osvdev-docs +``` + +## Running docs locally (native) To run the docs locally: diff --git a/docs/docs.Dockerfile b/docs/docs.Dockerfile new file mode 100644 index 00000000000..4ee811abd7c --- /dev/null +++ b/docs/docs.Dockerfile @@ -0,0 +1,23 @@ +# Use an official Ruby runtime as a parent image. +FROM ruby:4 + +# Set the working directory in the container. +WORKDIR /usr/src/app + +# Copy the Gemfile and Gemfile.lock, and the bundle config. +# This is done first to leverage Docker's layer caching. +COPY ./Gemfile* ./ +COPY .bundle ./.bundle + +# Install the dependencies. +RUN bundle install + +# Copy the rest of the documentation files. +COPY ./ ./ + +# Expose port 4000 for the Jekyll server. +EXPOSE 4000 + +# The command to run when the container starts. +# --host 0.0.0.0 is important to make the server accessible from outside the container. +CMD ["bundle", "exec", "jekyll", "serve", "--host", "0.0.0.0"] From c9c5fa2e5c75ec3e33d2cfd44df2c75330959992 Mon Sep 17 00:00:00 2001 From: Xueqin Cui Date: Mon, 16 Feb 2026 16:59:22 +1100 Subject: [PATCH 3/5] mention to run in docs directory --- docs/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/README.md b/docs/README.md index acf260ff58f..91c51a7cbfd 100644 --- a/docs/README.md +++ b/docs/README.md @@ -4,7 +4,7 @@ The [OSV.dev docs](https://osv.dev/docs) are hosted on [GitHub Pages](https://pa ## Running docs locally (docker) -You can run the docs locally consistently through docker: +You can run the docs locally consistently through docker. From the `docs` directory, run: ```bash docker build -t osvdev-docs -f docs.Dockerfile . From bfa04aec97f872429bdfbcbf2bdf76baa1818e33 Mon Sep 17 00:00:00 2001 From: Xueqin Cui Date: Fri, 20 Feb 2026 15:13:38 +1100 Subject: [PATCH 4/5] update dockerfile --- docs/docs.Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/docs.Dockerfile b/docs/docs.Dockerfile index 4ee811abd7c..155fcc53e42 100644 --- a/docs/docs.Dockerfile +++ b/docs/docs.Dockerfile @@ -1,5 +1,5 @@ # Use an official Ruby runtime as a parent image. -FROM ruby:4 +FROM ruby:3.3 # Set the working directory in the container. WORKDIR /usr/src/app @@ -7,7 +7,6 @@ WORKDIR /usr/src/app # Copy the Gemfile and Gemfile.lock, and the bundle config. # This is done first to leverage Docker's layer caching. COPY ./Gemfile* ./ -COPY .bundle ./.bundle # Install the dependencies. RUN bundle install From ae6692dc6157e6ca71d6415a16d0d8adb58f5684 Mon Sep 17 00:00:00 2001 From: Xueqin Cui Date: Fri, 20 Feb 2026 15:26:20 +1100 Subject: [PATCH 5/5] ruby --- docs/docs.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docs.Dockerfile b/docs/docs.Dockerfile index 155fcc53e42..d9e5cc8355b 100644 --- a/docs/docs.Dockerfile +++ b/docs/docs.Dockerfile @@ -1,5 +1,5 @@ # Use an official Ruby runtime as a parent image. -FROM ruby:3.3 +FROM ruby:3 # Set the working directory in the container. WORKDIR /usr/src/app