Skip to content
Merged
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
37 changes: 33 additions & 4 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,35 @@
# OpenAPI generation
# README

## Prerequisites
The [OSV.dev docs](https://osv.dev/docs) are hosted on [GitHub Pages](https://pages.github.com/).

## Running docs locally (docker)

You can run the docs locally consistently through docker. From the `docs` directory, run:

```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:

- 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:

Expand Down Expand Up @@ -28,8 +57,8 @@ To install the protobuf service converter, run:
go mod download
```

## Generation
### Generation

```
```bash
python3 ./build_swagger.py
```
22 changes: 22 additions & 0 deletions docs/docs.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Use an official Ruby runtime as a parent image.
FROM ruby:3

# 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* ./

# 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"]
Loading