Skip to content

Docker

Shelf runs as a Docker container with documentation and configuration files mounted as volumes.

Basic Setup

yaml
# docker-compose.yml
services:
  shelf:
    image: ghcr.io/cocoar-dev/shelf:latest
    ports:
      - "80:8080"
    volumes:
      - docs-data:/data/docs
      - config-data:/data/config:ro
    environment:
      - Shelf__ApiKey=${SHELF_API_KEY:-}
    restart: unless-stopped

Two volumes:

If you don't use the Upload API and only deploy manually, you can mount the docs volume as :ro (read-only).

Volume Mounting

Single Volume

The simplest approach. All products live in one volume:

yaml
volumes:
  - docs-data:/data/docs
  - config-data:/data/config:ro

One Volume Per Product

Useful when products are deployed independently:

yaml
volumes:
  - config-docs:/data/docs/configuration
  - caps-docs:/data/docs/capabilities

Host Directory

For development or simple setups, mount host directories directly:

yaml
volumes:
  - /srv/docs:/data/docs
  - /srv/config:/data/config:ro

Environment Variables

See Configuration for all options. The most important ones for Docker:

VariableDefaultDescription
Shelf__DocsRoot/data/docsRoot directory for documentation files
Shelf__ConfigRoot/data/configRoot directory for product config files
Shelf__ApiKey(empty)API key for upload endpoint. Empty = upload disabled
Shelf__PathBase(empty)Global URL prefix (e.g. /docs)

Building From Source

bash
docker compose build

Or build the image directly:

bash
docker build -t cocoar/shelf .

Shelf your Docs.