Skip to content

Commit

Permalink
Add a basic README (#8)
Browse files Browse the repository at this point in the history
Signed-off-by: Juan Cruz Viotti <[email protected]>
  • Loading branch information
jviotti authored Nov 12, 2024
1 parent 69f7a27 commit 8ce962d
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions README.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
Sourcemeta Registry
===================

A high-performance OEM micro-service to serve collections of JSON Schema over
HTTP and build a schema registry for your organisation.

Configuration
-------------

The Sourcemeta Registry requires a configuration file that defines the schema
collections and pages the instance will serve. See
[`schemas/configuration.json`](./schemas/configuration.json) for the JSON
Schema that defines this configuration file format. The format is designed to
be easy to understand and performant to interact with at runtime. Here is an
example:

```json
{
"url": "http://localhost:8000",
"port": 8000,
"collections": {
"example/schemas": {
"base": "https://example.com/schemas",
"path": "./schemas/example/folder"
}
}
}
```

The `url` property defines the base URL of the instance and will be used for
reidentifying schemas at runtime, so make sure its correct. The `port` property
is optional. The `collections` property mounts a given directory of schemas
into a certain relative path.

Deployment
----------

We release a small `registry` Docker base image to [GitHub
Packages](https://github.com/sourcemeta/registry/pkgs/container/registry) that
you are expected to extend for your own deployment as follows. Replace any `{{
}}` variable with the values of your choosing:

```docker
FROM ghcr.io/sourcemeta/registry:{{ version }}
# Copy your configuration file (see previous section) and schema files
COPY {{ path/to/configuration.json }} /app/configuration.json
COPY {{ path/to/schemas }} /app/schemas
# Index your schema directory given your configuration
RUN sourcemeta-registry-index /app/configuration.json /app/index \
&& rm -rf /app/schemas /app/configuration.json
# Run the registry against your indexed directory
ENTRYPOINT [ "/usr/bin/sourcemeta-registry-serve" ]
CMD [ "/app/index" ]
```

0 comments on commit 8ce962d

Please sign in to comment.